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

OnSelectedIndexChanged does not fire.

3 Answers 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 2
Paul asked on 11 Mar 2009, 09:30 PM
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> 
 

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 12 Mar 2009, 05:09 AM
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.
0
Paul
Top achievements
Rank 2
answered on 12 Mar 2009, 05:36 AM

Hi Princy

 

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

 

Paul

0
danparker276
Top achievements
Rank 2
answered on 16 Mar 2013, 05:32 PM
I think you should include this note on the selection demo. 
Tags
Grid
Asked by
Paul
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Paul
Top achievements
Rank 2
danparker276
Top achievements
Rank 2
Share this question
or