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

Problem with sorting RadGrid

1 Answer 36 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kenneth Miller
Top achievements
Rank 1
Kenneth Miller asked on 28 Feb 2017, 01:52 PM

I have run into a problem when sorting a RadGrid. I am using the advanced databinding option in a grid creating in the markup. When I click on a grid header, the sort happens properly for that column, and the arrow indicator appears. If I then click on the indicator to do the opposite sort, the sorting indicator jumps to the next column to the right. This proceeds that way all across the grid.

I found this problem referenced in one older ticket from 2013, but that one simply indicated that the problem was resolved by using advanced databinding. I am already doing that, so what else am I missing?

 

My grid is defined as given here:

 

 <telerik:RadGrid ID="RecalledUPCDisplay" runat="server" Width="700px"  OnNeedDataSource="RadGrid1_NeedDataSource"
                OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"  OnHTMLExporting="RadGrid1_HtmlExporting" AllowSorting="True"
                 AutoGenerateColumns="False" Height="400px" Skin="Web20" ItemStyle-Height="18"
                        AlternatingItemStyle-Height="20">

                <ClientSettings EnablePostBackOnRowClick="true" >
                     <Scrolling AllowScroll="True" ScrollHeight="300px" UseStaticHeaders="True" />
                     <Selecting AllowRowSelect="True" />

                         
                </ClientSettings>
                
                <MasterTableView EnableViewState="False" HeaderStyle-HorizontalAlign="Center" Font-Names="Arial"  Font-Size="8" UseAllDataFields="true" DataKeyNames="UPC">
                <Columns>

                                     
                                   <telerik:GridBoundColumn DataField="UPC" HeaderText="UPC"
                                          UniqueName="UPC" SortExpression="UPC">
                                          <HeaderStyle HorizontalAlign="Center" Width="20" />
                                          <ItemStyle HorizontalAlign="Center"/>
                                          
                                      </telerik:GridBoundColumn>

                                 <telerik:GridBoundColumn DataField="Description" HeaderText="Description"
                                          UniqueName="Description">
                                          <HeaderStyle HorizontalAlign="Center" Width="60" />
                                          <ItemStyle HorizontalAlign="Center"/>
                                      </telerik:GridBoundColumn>

                                   <telerik:GridBoundColumn DataField="DateEntered" HeaderText="Date Entered"
                                          UniqueName="DateEntered">
                                          <HeaderStyle HorizontalAlign="Center" Width="15" />
                                          <ItemStyle HorizontalAlign="Center"/>
                                      </telerik:GridBoundColumn>

                                 <telerik:GridBoundColumn DataField="Comment" HeaderText="Comment"
                                          UniqueName="Comment">
                                          <HeaderStyle HorizontalAlign="Center" Width="20" />
                                          <ItemStyle HorizontalAlign="Center"/>
                                      </telerik:GridBoundColumn>


              </Columns>


              </MasterTableView>

                    <SortingSettings SortedBackColor="#FFF6D6" EnableSkinSortStyles="True"></SortingSettings>


                 <ExportSettings  IgnorePaging="False" OpenInNewWindow="True" ExportOnlyData="True">

                  <Csv ColumnDelimiter="VerticalBar" EncloseDataWithQuotes="False" />

            </ExportSettings>

    </telerik:RadGrid>

 

 

And the NeedDataSource call:

 

    Protected Sub RadGrid1_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs)
        TryCast(sender, RadGrid).DataSource = BLLInterface.GetRecalledUPCs
    End Sub

 

 

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 03 Mar 2017, 06:09 AM
Hello Kenneth,

Please make sure that you are using a recent version of the controls. I am sending a sample RadGrid web site with basic sorting implementation. Please run the attached application and verify that it works properly on your side, too.

Regards,
Eyup
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Kenneth Miller
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or