This is a migrated thread and some comments may be shown as answers.

SelectedIndexChanged Event

4 Answers 185 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 19 Nov 2008, 11:36 PM
So what fires the selectedindexchanged event for the Grid?  Is it only clicking a column that has the GridColumnSelectButton?  Is there a way to trigger an even whenever the row is selected?  I would like to use the full row select option, and tap into an event on the server that fires when that happens.  But I see that event doesn't fire when that happens.

So is there an event that fires when a row is clicked?  I didn't see one...

Thanks.

4 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 20 Nov 2008, 04:07 AM
Hi Brian,

Set the EnablePostBackOnRowClick property to true. This will cause the SelectedIndexChanged event as well as the ItemCommand event to fire on selecting or clicking a row.

ASPX:
<ClientSettings  EnablePostBackOnRowClick="true" > 
                <Selecting  AllowRowSelect="true" /> 
                </ClientSettings> 


CS:
 protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
       // here you can check the row click event
        if (e.CommandName == "RowClick") 
        { 
         
        } 
    } 

Thanks
Shinu
0
Princy
Top achievements
Rank 2
answered on 20 Nov 2008, 04:13 AM

0
Brian Mains
Top achievements
Rank 1
answered on 20 Nov 2008, 01:45 PM
Hey,

Thanks, SelectedIndexChanged event didn't fire, but ItemCommand did.

Brian
0
Shinu
Top achievements
Rank 2
answered on 21 Nov 2008, 06:10 AM
Hi Brian,

The SelectedIndexChanged event did fire properly on my end. Have you set the event handler for the SelectedIndexChanged event in the aspx?

ASPX:
 <telerik:RadGrid ID="RadGrid1"  runat="server"     DataSourceID="SqlDataSource1"    OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"  > 


Shinu.
Tags
Grid
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Brian Mains
Top achievements
Rank 1
Share this question
or