Sorting and Paging are not working in Datagrid WebForms Control

G

Guest

I create a simple web application with 1 datagrid control bound to a
customers table. I set the AllowSorting and AllowPaging properties to True.
When I view the aspx page in internet explorer and click on the sorting link
the datagrid is not sorted. When I click on the next page link I am sent to
the same page.
 
K

Ken Tucker [MVP]

Hi,

You need to add code to the sortcommand and pageindexchanged events
to get the grid to update itself correctly.

http://msdn.microsoft.com/library/d...ontrolsdatagridclasspageindexchangedtopic.asp

http://msdn.microsoft.com/library/d...iwebcontrolsdatagridclasssortcommandtopic.asp

Ken
-------------------
I create a simple web application with 1 datagrid control bound to a
customers table. I set the AllowSorting and AllowPaging properties to True.
When I view the aspx page in internet explorer and click on the sorting link
the datagrid is not sorted. When I click on the next page link I am sent to
the same page.
 

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

Top