DataGrid help on Datagrid's SelectedIndexChanged event

Discussion in 'ASP .Net Web Controls' started by Eric, May 16, 2005.

  1. Eric

    Eric Guest

    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
     
    Eric, May 16, 2005
    #1
    1. Advertising

  2. 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
     
    Steve Goodyear, May 21, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dominic
    Replies:
    2
    Views:
    738
    Saravana
    Jul 4, 2003
  2. Shiva
    Replies:
    3
    Views:
    32,325
    leoykl
    Jun 14, 2012
  3. Shiva
    Replies:
    0
    Views:
    468
    Shiva
    Nov 17, 2004
  4. Arthur Dent
    Replies:
    0
    Views:
    564
    Arthur Dent
    Dec 23, 2004
  5. The Colonel
    Replies:
    0
    Views:
    584
    The Colonel
    Jan 24, 2005
Loading...

Share This Page