S
swesorick
I'm trying to figure out the Sorting and PagingCallbacks in the asp.Net
2.0 GridView Control. Whenever I set EnableSortingAndPagingCallbacks
to true, I cannot get sorting to work. Paging works, but not sorting.
The GridView sorting and paging events do not seem to fire when
EnableSortingAndPagingCallbacks is set to true. Somehow the GridView
is smart enough to switch the paging during the callback, but not
switch the sorting. In the trace, I can even see the __CALLBACKID and
__CALLBACKPARAM form variables. Unfortunately, I couldn't decipher how
to read the __CALLBACKPARAM variable. What am I missing, here?
<asp:GridView ID="grdCustomers" runat="server" AllowSorting="True"
AutoGenerateColumns="False" AutoGenerateDeleteButton="True"
AutoGenerateEditButton="True"
EnableSortingAndPagingCallbacks="True"
EnableViewState="True" AllowPaging="true">
<PagerSettings NextPageText="next" PreviousPageText="back" />
<Columns>
<asp:BoundField DataField="CustomerName"
HeaderText="Customer Name" SortExpression="CustomerName" />
<asp:BoundField DataField="AccountNum" HeaderText="Axapta
ID" SortExpression="AccountNum" />
</Columns>
</asp:GridView>
2.0 GridView Control. Whenever I set EnableSortingAndPagingCallbacks
to true, I cannot get sorting to work. Paging works, but not sorting.
click on a sorting link or paging link.From viewing the trace log, I can see that the page fires each time you
The GridView sorting and paging events do not seem to fire when
EnableSortingAndPagingCallbacks is set to true. Somehow the GridView
is smart enough to switch the paging during the callback, but not
switch the sorting. In the trace, I can even see the __CALLBACKID and
__CALLBACKPARAM form variables. Unfortunately, I couldn't decipher how
to read the __CALLBACKPARAM variable. What am I missing, here?
<asp:GridView ID="grdCustomers" runat="server" AllowSorting="True"
AutoGenerateColumns="False" AutoGenerateDeleteButton="True"
AutoGenerateEditButton="True"
EnableSortingAndPagingCallbacks="True"
EnableViewState="True" AllowPaging="true">
<PagerSettings NextPageText="next" PreviousPageText="back" />
<Columns>
<asp:BoundField DataField="CustomerName"
HeaderText="Customer Name" SortExpression="CustomerName" />
<asp:BoundField DataField="AccountNum" HeaderText="Axapta
ID" SortExpression="AccountNum" />
</Columns>
</asp:GridView>