[英]Grid view sorting
我正在使用此代碼在網格視圖中進行排序,但這不起作用。 請幫忙
<asp:TemplateField SortExpression="FirstName">
<HeaderTemplate>
Name
</HeaderTemplate>
<ItemTemplate>
<%# Eval("Name")%>
</ItemTemplate>
</asp:TemplateField>
您提到您沒有在表的標題處看到鏈接。
可能對您有幫助
確保設置了AllowSorting="true"
並創建了一個處理它的事件OnSorting="gvActivities_Sorting"
<asp:GridView runat="server" ID="gvActivities" AllowSorting="true"
OnSorting="gvActivities_Sorting">
如果這樣做,您應該在標題中獲得一個鏈接。
如果沒有發布所有gridview
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.