分页方法中传递排序表达式和方向参数 [英] passing sort expression and direction parameters in pagination method
本文介绍了分页方法中传递排序表达式和方向参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在分页方法中传递soret表达式和方向
passing soret expression and direction in pagination method
推荐答案
在给定的标记集中,GridView
属性如下所示
In Markup setGridView
attributes as given bellow
AllowSorting="True"
OnSorting="gridView_Sorting"
对于每列标题模板,请执行以下操作
For each column Header Template do the following
<asp:TemplateField SortExpression="YourFieldName">
<HeaderTemplate>
<asp:LinkButton ID="linkbutton" runat="server" Width="100%" CommandName="Sort" CommandArgument=" YourFieldName" />
</HeaderTemplate>
<ItemTemplate></ItemTemplate?
</asp:TemplateField>
还有
在gridview_Sorting
事件处理程序后面的代码中
使用e.SortExpression
和e.SortDirection
进一步实现该逻辑.
HTH
And
In code behind gridview_Sorting
event handler
Use e.SortExpression
and e.SortDirection
to further implement the logic.
HTH
这篇关于分页方法中传递排序表达式和方向参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文