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

onselectedindexchanged Event doesn't fired

3 Answers 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeff Tang
Top achievements
Rank 1
Jeff Tang asked on 26 Nov 2008, 07:48 AM

Below is my grid, I don't know why the server event "onselectedindexchanged" does not fired when I click a row. Thanks.


<telerik:RadGrid ID="tblSpDetl" runat="server" AutoGenerateColumns="False" GridLines="None"
                                             Skin="WebBlue" Width="100%" AllowPaging="True" AllowSorting="True"
                                             BorderColor="#6699FF" BorderStyle="None" BorderWidth="1px" onselectedindexchanged="tblSpDetl_SelectedIndexChanged" >
                                
                                 <SelectedItemStyle BackColor="#99CCFF" />    
                           
                                 <ClientSettings>
                                               <Selecting AllowRowSelect="True" />
                                               <ClientEvents OnRowClick="Row_Single_Click"  />                                       
                                               <Scrolling AllowScroll="True" ScrollHeight="100px" SaveScrollPosition="False"></Scrolling> 
                                 </ClientSettings>  
                               
                                <MasterTableView CommandItemDisplay="None" CurrentResetPageIndexAction="SetPageIndexToFirst"
                                                 Dir="LTR" Frame="Border" TableLayout="Auto" Width="98%"    
                                                 ClientDataKeyNames="CUST_NAME, CUST_TYPE, FLAT, FLOOR, POS, BLK, CUST_TYPE, MAJOR_INST, PHONE_NO, SN, REMARK"
                                                 AllowPaging="False" 
                                 onselectedindexchanged="tblSpDetl_SelectedIndexChanged" >
                                                                  
                                    <RowIndicatorColumn>
                                        <HeaderStyle Width="20px" />
                                    </RowIndicatorColumn>
                                    <ExpandCollapseColumn>
                                        <HeaderStyle Width="20px" />
                                    </ExpandCollapseColumn>
                                                                  
                                    <Columns>
                                        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                                                                ForceExtractValue="None" HeaderText="Name" UniqueName="CUST_NAME"
                                                                DataField="CUST_NAME">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                                                                 ForceExtractValue="None" HeaderText="Special Customer Type"
                                                                 UniqueName="CUST_TYPE" DataField="CUST_TYPE">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                                                                 ForceExtractValue="None" HeaderText="Flat"
                                                                 UniqueName="FLAT" DataField="FLAT" Visible="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                                                                 ForceExtractValue="None" HeaderText="Floor"
                                                                 UniqueName="FLO0R" DataField="FLOOR" Visible="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                                                                 ForceExtractValue="None" HeaderText="Pos"
                                                                 UniqueName="POS" DataField="POS" Visible="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                                                                 ForceExtractValue="None" HeaderText="Blk"
                                                                 UniqueName="BLK" DataField="BLK" Visible="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                                                                 ForceExtractValue="None" HeaderText="Cust. Type"
                                                                 UniqueName="CUST_TYPE" DataField="CUST_TYPE" Visible="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                                                                 ForceExtractValue="None" HeaderText="Major Inst"
                                                                 UniqueName="MAJOR_INST" DataField="MAJOR_INST" Visible="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                                                                 ForceExtractValue="None" HeaderText="Phone No."
                                                                 UniqueName="PHONE_NO" DataField="PHONE_NO" Visible="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                                                                 ForceExtractValue="None" HeaderText="SN"
                                                                 UniqueName="SN" DataField="SN" Visible="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                                                                 ForceExtractValue="None" HeaderText="Remark"
                                                                 UniqueName="REMARK" DataField="REMARK" Visible="false">
                                        </telerik:GridBoundColumn>
                                    </Columns>

                                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                    <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False"
                                                 Font-Strikeout="False" Font-Underline="False" ForeColor="Black" Wrap="True" />
                                    <FooterStyle HorizontalAlign ="Left" /> 
                                </MasterTableView>
                                 <FilterMenu EnableTheming="True" Skin="WebBlue">
                                     <CollapseAnimation Duration="200" Type="OutQuint" />
                                 </FilterMenu>
                            </telerik:RadGrid>

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 26 Nov 2008, 07:55 AM
Hi Jeff,

You need to set ClientSettings.EnablePostBackOnRowClick to true if you want immediate request to the server on client-side selection.

Best wishes,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jeff Tang
Top achievements
Rank 1
answered on 27 Nov 2008, 02:52 AM
It seems that the Ajax is not work after I use this event.
0
Vlad
Telerik team
answered on 27 Nov 2008, 07:12 AM
Hello Jeff,

You can check this demo for more info:
http://demos.telerik.com/aspnet/Prometheus/Grid/Examples/Programming/SelectedValue/DefaultCS.aspx

Best wishes,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Jeff Tang
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Jeff Tang
Top achievements
Rank 1
Share this question
or