New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

SelectedIndexChanged Event

Fired when a different item is selected in a data listing control between posts to the server.

Event Parameters

  • (object) sender

    • The control that fires the event
  • (EventArgs) e

    • Does not contain arguments

Attaching the event

In the Markup

<telerik:RadGrid ID="RadGrid1" runat="server" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged">
       <Selecting AllowRowSelect="true" />

In the Code behind

protected void Page_Init(object sender, EventArgs e)
    RadGrid1.SelectedIndexChanged += RadGrid1_SelectedIndexChanged;
Protected Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
    AddHandler RadGrid1.SelectedIndexChanged, AddressOf RadGrid1_SelectedIndexChanged
End Sub

The event handler

protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
    GridItem item = RadGrid1.SelectedItems[0];
Protected Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
    Dim item As GridItem = RadGrid1.SelectedItems(0)
End Sub

See Also

In this article