Hi,
I have a "Add New" button inside the grid and I am not able to add items to the grid.
protected void ResultGridView_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
if (e.CommandName.Equals("AddNew"))
{
TextBox Lob = (TextBox)GridView1.FooterRow.FindControl("txtLob");
TextBox LobDescription = (TextBox)GridView1.FooterRow.FindControl("txtLobDescription");
LOBDataBO.InsertLOBValues(Lob.Text, LobDescription.Text);
FillVendorGrid();
}
}
catch (Exception exc)
{
Logger.LogError(exc, MethodBase.GetCurrentMethod().ToString());
UtilityMethods.RedirectToErrorPage(Constants.Message_ErrorProcessingRequest);
}
}
Loading
Iftikar HussainPosted Aug 8, 2013, 8:17 AM
set EditIndex before binding the grid
GridView1.EditIndex = -1;
FillVendorGrid();
Regards,
Iftikar
Vignesh KumarPosted Aug 8, 2013, 7:50 AM
PFA for better clarity.
Vignesh KumarPosted Aug 8, 2013, 7:43 AM
INSERT INTO [BSP_LOB_Lookup]([BSP_LOB_CD], [BSP_LOB_DESC]) Values('"
+ lob + "', '" + lobDesc + "')"Iftikar HussainPosted Aug 8, 2013, 7:32 AM
Regards,
Iftikar
Vignesh KumarPosted Aug 8, 2013, 7:28 AM
Iftikar HussainPosted Aug 8, 2013, 7:11 AM
Put the break point and check the value for Lob.Text and LobDescription
Regards,
Iftikar