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

Sorting problem with Radgrid

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tabassum
Top achievements
Rank 1
Tabassum asked on 09 Mar 2015, 10:20 AM
Hi,

 When I click on a column of a radgrid, grid.SortExpressions.GetSortString()  returns NULL on first click. On second click it returns clicked column name ASC on thrid click it returns clicked column DESC and on next click it returns NULLagain.

 Can you please advise me what is wrong here. Need to correct it ASAP.

My Code look like this:


<telerik:RadGrid ID="HmsCasesGridView" runat="server" AutoGenerateColumns="false" AllowSorting="true" Skin="Default" AllowPaging="true" AllowCustomPaging="true" PageSize="20">
<MasterTableView>
<Columns>
<telerik:GridHyperLinkColumn DataTextField="OpenActionTitle" DataNavigateUrlFields="EmployeeID,CaseID" DataNavigateUrlFormatString="../Forms/Case.aspx?EmployeeID={0}&CaseID={1}" Display="true">
</telerik:GridHyperLinkColumn>
<telerik:GridBoundColumn DataField="CaseID" />
<telerik:GridBoundColumn DataField="EmployeeID" />
<telerik:GridBoundColumn DataField="Name" />
<telerik:GridBoundColumn DataField="NextPlannedDate" DataFormatString="{0:dd.MM.yyyy}" />
<telerik:GridBoundColumn DataField="NextActivityName" />                
</Columns>
</MasterTableView>
</telerik:RadGrid>

Thank you,
Tabassum

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 11 Mar 2015, 05:46 PM
Hello,

How is the grid populated? In case you are using simple databinding calling DataBind() switch to advanced databanding through NeedDataSource as shown in the example below and let me know if the same problem still persists.
http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/simple-vs-advanced/defaultcs.aspx

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Tabassum
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or