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

Column Sorting Problem

1 Answer 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 05 Dec 2014, 03:48 PM
Hello Telerik, 

this is probably just a little something I forgot to put in my code but I can't seem to find it.

Basically I have this RadGrid and when I sort any column there's a postback but after that, the RadGrid is empty.

1) Allow sorting is set at true for the RadGrid AND for the Columns
2) The sorting expressions are the same as the DataField and Unique ID. (and for the Template column the sorting expression is the same value as I put in the link button or other controls with DataBinder.Eval(Container.DataItem, ''theSortingExpression'')

Right now, the data binding occurs only if its not a postback.
If I don't put the data binding in the postback, it just says invalid postback argument (because the Unique ID will not be the same anymore, which is normal)

How am I supposed to use the sorting properly with DataBinding in the code behind

Thanks !

1 Answer, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 05 Dec 2014, 04:03 PM
Nevermind, I just solved the problem.. I left the code in the !IsPostBack statement, 
I added  OnNeedDataSource and now it works 
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Share this question
or