G
George Durzi
I have an editcommandcolumn in my datagrid, as follows.
<asp:editcommandcolumn ButtonType="LinkButton" UpdateText="Update"
CancelText="Cancel" EditText="Edit">
I'd like to set the CausesValidation property of the Update portion to
false. Can't seem to get it to work. The Edit and Cancel linkbuttons have
CausesValidation turned off by default.
That cell in that row of my datagrid is being rendered in my trace, as
follows
dgCAReminders:_ctl3:_ctl1 System.Web.UI.WebControls.DataGridLinkButton
When I click Edit, two linkbuttons are rendered:
dgCAReminders:_ctl3:_ctl1 System.Web.UI.WebControls.DataGridLinkButton
dgCAReminders:_ctl3:_ctl5 System.Web.UI.LiteralControl
dgCAReminders:_ctl3:_ctl2 System.Web.UI.WebControls.DataGridLinkButton
I tried doing something in the OnItemCreated of the datagrid: (The
editcommandcolumn is in cell 1)
((LinkButton)e.Item.Cells[1].Controls[0]).CausesValidation = false;
But after looking at the trace, I realized that it doesn't make sense coz
the update linkbutton hasn't been rendered.
So I moved the above code to the OnEditCommand event, but I got the same
result.
What am I missing?
<asp:editcommandcolumn ButtonType="LinkButton" UpdateText="Update"
CancelText="Cancel" EditText="Edit">
I'd like to set the CausesValidation property of the Update portion to
false. Can't seem to get it to work. The Edit and Cancel linkbuttons have
CausesValidation turned off by default.
That cell in that row of my datagrid is being rendered in my trace, as
follows
dgCAReminders:_ctl3:_ctl1 System.Web.UI.WebControls.DataGridLinkButton
When I click Edit, two linkbuttons are rendered:
dgCAReminders:_ctl3:_ctl1 System.Web.UI.WebControls.DataGridLinkButton
dgCAReminders:_ctl3:_ctl5 System.Web.UI.LiteralControl
dgCAReminders:_ctl3:_ctl2 System.Web.UI.WebControls.DataGridLinkButton
I tried doing something in the OnItemCreated of the datagrid: (The
editcommandcolumn is in cell 1)
((LinkButton)e.Item.Cells[1].Controls[0]).CausesValidation = false;
But after looking at the trace, I realized that it doesn't make sense coz
the update linkbutton hasn't been rendered.
So I moved the above code to the OnEditCommand event, but I got the same
result.
What am I missing?