Home All Groups Group Topic Archive Search About

DataGrid help on Datagrid's SelectedIndexChanged event

Author
16 May 2005 5:42 PM
Eric
Hi,

I have two Select button columns on my datagrid control. What is the easiest
solution to know which control has been pressed by the user.

When I press any of the two controls, it goes directly to the 
DataGrid_SelectedIndexChanged event...

thank you

Author
21 May 2005 5:15 AM
Steve Goodyear
Hi Eric,

You can name the commands like:
<asp:ButtonColumn CommandName="Select2" ...

and then capture the event in ItemCommand instead of SelectedIndexChanged
like:
private void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
  {
    if (e.CommandName.Equals("Select2"))
    ...

Cheers,
Steve Goodyear