Reputation: 417
According to the GridView documentation on MSDN, setting AllowPaging = true on an ASP.NET GridView control automatically creates a LinkButton control at the top of every column, but I am just getting static text on this very simple bit of code. Any ideas are greatly appreciated!
<asp:GridView ID="grdAttachments" runat="server" AllowPaging="true" AllowSorting="true" AutoGenerateColumns="false" DataKeyNames="pKey"
OnSorting="grdAttachments_Sorting" >
<Columns>
<asp:BoundField HeaderText="Date" DataField="AttchDate" />
<asp:BoundField HeaderText="File Name" DataField="AttchPath" />
<asp:BoundField HeaderText="Attached By" DataField="AttchBy" />
</Columns>
</asp:GridView>
Upvotes: 0
Views: 124
Reputation: 2592
Because there is no SortExpression
property on your BoundField controls.. you should change it to:
<Columns>
<asp:BoundField HeaderText="Date" DataField="AttchDate" SortExpression="AttchDate" />
<asp:BoundField HeaderText="File Name" DataField="AttchPath" SortExpression="AttchPath" />
<asp:BoundField HeaderText="Attached By" DataField="AttchBy" SortExpression="AttchBy" />
</Columns>
now you will see the link buttons in the column header.
Upvotes: 1