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

SelectedIndexChanged Not Firing

1 Answer 41 Views
This is a migrated thread and some comments may be shown as answers.
Bryan Hughes
Top achievements
Rank 1
Bryan Hughes asked on 11 Jan 2013, 09:41 PM
I am using the Web Mail Demo as an example source for new layout I need.  Everything works fine except the SelectedIndexChanged is not working when a new row is selected.  I have EnablePostBackOnRowClick=True in Grid cleint settings. and Event for SelectedIndexChanged but it never fires event and loads selected data in DetailsView.

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false"
                GridLines="None" Height="100%" BorderWidth="0" AllowSorting="true"
                ShowGroupPanel="true" Skin="Windows7">
                <ClientSettings Scrolling-AllowScroll="True" Scrolling-UseStaticHeaders="True" Selecting-AllowRowSelect="True" EnablePostBackOnRowClick="True" EnableRowHoverStyle="True"
                <MasterTableView TableLayout="Fixed" GroupLoadMode="Client" DataKeyNames="MessageGUID" ClientDataKeyNames="MessageGUID" Width="100%" OnSelectedIndexChanged="RadGrid1_RowSelected">
                                <telerik:GridGroupByField FieldName="GroupDate" HeaderText="Date" FormatString="{0}" />
                                <telerik:GridGroupByField FieldName="Grouping" SortOrder="Ascending" HeaderText="Sort By Date" />
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn1">
                            <HeaderStyle Width="24px" />
                            <ItemStyle VerticalAlign="Middle"/>
                                <img src="~/images/icon-msg-read.gif" id="mailicon" runat="server" style="width: 16px; height: 16px" alt="MailIcon" align="middle" />
                        <Telerik:GridBoundColumn HeaderStyle-Width="130px" HeaderText="To" Visible="false" DataField="ToUserFullName" SortExpression="ToUserFullName" UniqueName="ToUserFullName" >
                        <Telerik:GridBoundColumn HeaderStyle-Width="130px" HeaderText="From" DataField="FromUserFullName" SortExpression="FromUserFullName" UniqueName="FromUserFullName" >
                        <Telerik:gridboundcolumn HeaderText="Subject" DataField="Subject" SortExpression="Subject" UniqueName="Subject" />
                        <Telerik:GridBoundColumn UniqueName="DateCreated" SortExpression="DateCreated" HeaderText="Received" DataField="DateCreated" HeaderStyle-Width="150px">
Protected Sub RadGrid1_RowSelected(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs)
        Session("SelectedMessage") = RadGrid1.SelectedValue.ToString
        Dim errors As String = ""
    End Sub

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 16 Jan 2013, 12:03 PM
Hello Bryan,

I was not able to reproduce the issue. I noticed that you attached the event on the MasterTableView. What I could suggest you is to hook it on the RadGrid itself. Check out the following code snippet:
<telerik:RadGrid ID="RadGrid1" runat="server" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged">

Additionally I prepared a small sample based on your code and attached it to this thread.

the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Asked by
Bryan Hughes
Top achievements
Rank 1
Answers by
Telerik team
Share this question