M
Mark
I have two buttons in a DataGrid. If I leave the ButtonType = "LinkButton",
the EditCommand and DeleteCommand events fire fine. If I change th
ButtonType = "PushButton", the events do not fire. Does this buttonType
property change how the events fire? Suggestions? I have the ItemCommand
event wired up to, but that only fires for the LinkButton as well.
A few code samples below ...
Thanks!
Mark
*** Code - I left out the brackets intentionally as I wasn't sure if they'd
get mangled when sent via email. ***
** The following will fire the EditCommand event.
asp:ButtonColumn Text="Edit" CommandName="Edit" ButtonType="LinkButton"
** The following will NOT fire the EditCommand event.
asp:ButtonColumn Text="Edit" CommandName="Edit" ButtonType="PushButton"
this.DataGrid1.ItemCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_ItemCom
mand);
this.DataGrid1.EditCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_EditCom
mand);
this.DataGrid1.DeleteCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_DeleteC
ommand);
the EditCommand and DeleteCommand events fire fine. If I change th
ButtonType = "PushButton", the events do not fire. Does this buttonType
property change how the events fire? Suggestions? I have the ItemCommand
event wired up to, but that only fires for the LinkButton as well.
A few code samples below ...
Thanks!
Mark
*** Code - I left out the brackets intentionally as I wasn't sure if they'd
get mangled when sent via email. ***
** The following will fire the EditCommand event.
asp:ButtonColumn Text="Edit" CommandName="Edit" ButtonType="LinkButton"
** The following will NOT fire the EditCommand event.
asp:ButtonColumn Text="Edit" CommandName="Edit" ButtonType="PushButton"
this.DataGrid1.ItemCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_ItemCom
mand);
this.DataGrid1.EditCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_EditCom
mand);
this.DataGrid1.DeleteCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_DeleteC
ommand);