GridView EnableSortingAndPagingCallbacks

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.
From viewing the trace log, I can see that the page fires each time you
click on a sorting link or paging link.

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top