G
Guest
Hello,
I created a datagrid where I set the Events to there associated functions
(i.e. Grid1_UpdateCommand, etc.). All these Events I have established work
as they are suppose to except for my Grid1_UpdateCommand.
I load my datagrid via a Select query. When my DataGrid is populated I have
a column with an Edit button in it. When you Select Edit to edit the row you
want, that column changes the Edit button to an Update and Cancel button.
The Cancel works fine, but when you modify the data in that row and press
Update my Grid1_UpdateCommand Event does not fire.
Can someone tell me what I'm doing wrong please?
FYI…This is what I have in my InitializeComponent so it know what event to
fire
private void InitializeComponent()
{
this.Grid1.PageIndexChanged += new
System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.Grid1_PageIndexChanged);
this.Grid1.CancelCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.Grid1_CancelCommand);
this.Grid1.EditCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.Grid1_EditCommand);
this.Grid1.SortCommand += new
System.Web.UI.WebControls.DataGridSortCommandEventHandler(this.Grid1_SortCommand);
this.Grid1.UpdateCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.Grid1_UpdateCommand);
this.Grid1.DeleteCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.Grid1_DeleteCommand);
this.Grid1.SelectedIndexChanged += new
System.EventHandler(this.Grid1_SelectedIndexChanged);
this.btnLoadFile.Click += new System.EventHandler(this.btnLoadFile_Click);
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
Thanks,
I created a datagrid where I set the Events to there associated functions
(i.e. Grid1_UpdateCommand, etc.). All these Events I have established work
as they are suppose to except for my Grid1_UpdateCommand.
I load my datagrid via a Select query. When my DataGrid is populated I have
a column with an Edit button in it. When you Select Edit to edit the row you
want, that column changes the Edit button to an Update and Cancel button.
The Cancel works fine, but when you modify the data in that row and press
Update my Grid1_UpdateCommand Event does not fire.
Can someone tell me what I'm doing wrong please?
FYI…This is what I have in my InitializeComponent so it know what event to
fire
private void InitializeComponent()
{
this.Grid1.PageIndexChanged += new
System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.Grid1_PageIndexChanged);
this.Grid1.CancelCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.Grid1_CancelCommand);
this.Grid1.EditCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.Grid1_EditCommand);
this.Grid1.SortCommand += new
System.Web.UI.WebControls.DataGridSortCommandEventHandler(this.Grid1_SortCommand);
this.Grid1.UpdateCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.Grid1_UpdateCommand);
this.Grid1.DeleteCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.Grid1_DeleteCommand);
this.Grid1.SelectedIndexChanged += new
System.EventHandler(this.Grid1_SelectedIndexChanged);
this.btnLoadFile.Click += new System.EventHandler(this.btnLoadFile_Click);
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
Thanks,