开发者

Sorting a gridview that has paging enabled

I have a list binding on a gridview.

HistoryGrid.DataSource = objGrid;
HistoryGrid.DataBind();

AllowSorting="true" AllowPaging="True"  

<asp:BoundFie开发者_StackOverflowld HeaderText="hits" DataField="numberOfHits" 
  SortExpression="numberOfHits" ItemStyle-HorizontalAlign="Center" />

This doesn`t work. What else do I need?


If you use a list object as DataSource then your sorting function will not work.

You can use a DataTable as DataSource to your Gridview and then it will work.

You can get more ideas from this thread: How to convert a GridView to DataTable and sort the DataTable?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜