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 HussainRank #423 · 5.9K reputationPosted Aug 8, 2013, 4:17 AM EDT
set EditIndex before binding the grid
GridView1.EditIndex = -1;
FillVendorGrid();
Regards,
Iftikar
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 8, 2013, 3:11 AM EDT
Put the break point and check the value for Lob.Text and LobDescription
Regards,
Iftikar
Vignesh KumarRank #1,579 · 1K reputationPosted Aug 8, 2013, 3:28 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 8, 2013, 3:32 AM EDT
Regards,
Iftikar
Vignesh KumarRank #1,579 · 1K reputationPosted Aug 8, 2013, 3:43 AM EDT
INSERT INTO [BSP_LOB_Lookup]([BSP_LOB_CD], [BSP_LOB_DESC]) Values('"
+ lob + "', '" + lobDesc + "')"Vignesh KumarRank #1,579 · 1K reputationPosted Aug 8, 2013, 3:50 AM EDT
PFA for better clarity.