P
Piotr
Hi,
I have a DataGrid with standard EditCommandColumn with PageIndex enabled.
Everything works fine.
When I add ButtonColumn
<asp:ButtonColumn
Text="Delete"
HeaderText=""
CommandName="Delete"/>
and modify DataGrid with
OnItemCommand="datagrid_Delete"
strange things happen. It seems to work until I click one of "Edit" buttons.
It changes properly to edit mode but then no matter what button I click next
("Cancel", "Update", some other "Edit" or one of page changing buttons) it
always runs OnItemCommand, and what's very strange, CommandName property has
always "Delete" value instead of "Cancel" , "Update" or whatever name of
button I clicked:
protected void datagrid_Delete(object o, DataGridCommandEventArgs e)
{
Response.Write("I clicked " + e.CommandName);
...
}
gives:
I clicked Delete
Strangly it works after another click...
Why the h... is that?
Thanks,
Piotr
I have a DataGrid with standard EditCommandColumn with PageIndex enabled.
Everything works fine.
When I add ButtonColumn
<asp:ButtonColumn
Text="Delete"
HeaderText=""
CommandName="Delete"/>
and modify DataGrid with
OnItemCommand="datagrid_Delete"
strange things happen. It seems to work until I click one of "Edit" buttons.
It changes properly to edit mode but then no matter what button I click next
("Cancel", "Update", some other "Edit" or one of page changing buttons) it
always runs OnItemCommand, and what's very strange, CommandName property has
always "Delete" value instead of "Cancel" , "Update" or whatever name of
button I clicked:
protected void datagrid_Delete(object o, DataGridCommandEventArgs e)
{
Response.Write("I clicked " + e.CommandName);
...
}
gives:
I clicked Delete
Strangly it works after another click...
Why the h... is that?
Thanks,
Piotr