OnSelectedIndexChanged does not fire.

4 posts, 1 answers
  1. Paul
    Paul avatar
    16 posts
    Member since:
    Mar 2009

    Posted 11 Mar 2009 Link to this post

    Hi

    I am new to the RadControls, but I am enjoying using them.

    I have an issue with the OnSelectedIndexChanged event not firing and running the codebehind.  I have it working with the standard Microsoft control but can't seem to get this one going.

    Below is the code I currently have.

    Thanks for your assistant.

    Paul

                <div class="equipSalesGrid">  
                    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="Web4.App_code.WebSiteContentDataContext" 
                        Select="new (ShortDescription, EquipmentId, ThumbNailURL)" TableName="EquipmentSales">  
                    </asp:LinqDataSource> 
                    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AutoGenerateColumns="False" 
                        DataSourceID="LinqDataSource1" GridLines="None" Skin="Black" Width="260px" PageSize="4" 
                         MasterTableView-DataKeyNames="EquipmentId" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged">  
                        <HeaderContextMenu> 
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </HeaderContextMenu> 
                        <MasterTableView DataSourceID="LinqDataSource1">  
                            <RowIndicatorColumn> 
                                <HeaderStyle Width="20px" /> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn> 
                                <HeaderStyle Width="20px" /> 
                            </ExpandCollapseColumn> 
                            <Columns> 
                                <telerik:GridBoundColumn DataField="EquipmentId" DataType="System.Int32" Display="False" 
                                    ReadOnly="True" UniqueName="column2">  
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="ShortDescription" HeaderText="Item" ReadOnly="True" 
                                    SortExpression="ShortDescription" UniqueName="column">  
                                </telerik:GridBoundColumn> 
                                <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="Image">  
                                    <ItemTemplate> 
                                        <asp:Image ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ThumbnailURL").ToString().Trim()%>' 
                                            ID="GridImage" runat="server" Height="100px" Width="100px" /> 
                                    </ItemTemplate> 
                                </telerik:GridTemplateColumn> 
                            </Columns> 
                        </MasterTableView> 
                        <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">  
                        <Selecting AllowRowSelect="true" /> 
                        </ClientSettings> 
                        <FilterMenu> 
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </FilterMenu> 
                    </telerik:RadGrid> 
                </div> 
     
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Mar 2009 Link to this post

    Hi Paul,

    Set the EnablePostBackOnRowClick property to true in order to fire the OnSelectedIndexChanged event of RadGrid.

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

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul
    Paul avatar
    16 posts
    Member since:
    Mar 2009

    Posted 12 Mar 2009 Link to this post

    Hi Princy

     

    It is easy when you know what you are doing.  :-) Thank you very much.

     

    Paul

  5. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 16 Mar 2013 Link to this post

    I think you should include this note on the selection demo. 
Back to Top