GridView Paging/Sorting without using the ObjectDataSource

G

Greg

I have a page with a gridView list I created. Initially, I used the
ObjectDataSource to populate the tabler, which returns all the records. But,
now I am creating a page to allow the user to filter the records returned,
which I have working fine. I am binding my Dataset to the gridview via the
Code-Behind form. I need this flexibility as I am dealing with a lot of
parameters.

Anyway, I noticed though that now that I am binding a dataset, rather than
using the ObjectDataSource my paging and sorting features no longer work.

How can I get the paging/sorting feature to work using a dataset than I am
binding to my gridview. I've seen some examples that involve quite a bit of
work. I'd like to find out if there are some built in features of the
gridview that would make this work.

Can anyone help me or point me in the right direction?
 
I

Ignacio Machin ( .NET/ C# MVP )

I have a page with a gridView list I created. Initially, I used the
ObjectDataSource to populate the tabler, which returns all the records. But,
now I am creating a page to allow the user to filter the records returned,
which I have working fine. I am binding my Dataset to the gridview via the
Code-Behind form. I need this flexibility as I am dealing with a lot of
parameters.

Anyway, I noticed though that now that I am binding a dataset, rather than
using the ObjectDataSource my paging and sorting features no longer work.

How can I get the paging/sorting feature to work using a dataset than I am
binding to my gridview. I've seen some examples that involve quite a bit of
work. I'd like to find out if there are some built in features of the
gridview that would make this work.

Can anyone help me or point me in the right direction?

I thinkl that in this case you have to do it manually. As the
datasource used to the grid is filtered outside of its control.
I'm working in an application with this features, we have sometimes
listing of 100K items and we do the filtering in the datatable and
only return the current page. You need to keep track of the current
page,etc on your own. Not as simple but it's not rocket science neither
 
C

Christophe Lephay

"Ignacio Machin ( .NET/ C# MVP )" <[email protected]> a écrit dans le
message de groupe de discussion :
(e-mail address removed)...
I thinkl that in this case you have to do it manually. As the
datasource used to the grid is filtered outside of its control.
I'm working in an application with this features, we have sometimes
listing of 100K items and we do the filtering in the datatable and
only return the current page. You need to keep track of the current
page,etc on your own. Not as simple but it's not rocket science neither

Couldn't it be related to viewstate ?

(Of course, viewstate is probably not a good idea with 100k items).
 
I

Ignacio Machin ( .NET/ C# MVP )

"Ignacio Machin ( .NET/ C# MVP )" <[email protected]> a écrit dans le
message de groupe de discussion :
(e-mail address removed)...





Couldn't it be related to viewstate ?

(Of course, viewstate is probably not a good idea with 100k items).

My case?
I only cache the page I'm viewing , 20 rows (the one I get from the SP)
 

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