Home All Groups Group Topic Archive Search About

Paging, Filtering and Sorting

Author
6 Jan 2006 7:33 PM
LDD
Hi Folks

I'm trying to determine a way to handle paging, filtering and sorting in a
datagrid.
If I choose to filter and sort, I'd like to return a subset. If that
resultset has more records then the number of rows I'd like to display, I'd
like to be able to load pages into the grid.

My question is, do I need to continually hit the db to get the next page of
records, or is there another method of doing with the dataset. i.e. load the
entire resultset into the dataset and pick up the next block of results as
neeeded.

thanks folks

LDD

Author
6 Jan 2006 7:43 PM
Marina
Take a look at the PagedDataSource class. It can do the paging for you, and
you can use a DataView to filter/sort. So point the PagedDataSource to your
filtered/sorted DataView, and you should be all set.

Show quoteHide quote
"LDD" <largedoubledou***@gmail.com> wrote in message
news:z8KdnQrUs4i8WyPenZ2dnUVZ_v6dnZ2d@magma.ca...
> Hi Folks
>
> I'm trying to determine a way to handle paging, filtering and sorting in a
> datagrid.
> If I choose to filter and sort, I'd like to return a subset. If that
> resultset has more records then the number of rows I'd like to display,
> I'd
> like to be able to load pages into the grid.
>
> My question is, do I need to continually hit the db to get the next page
> of
> records, or is there another method of doing with the dataset. i.e. load
> the
> entire resultset into the dataset and pick up the next block of results as
> neeeded.
>
> thanks folks
>
> LDD
>
>
Author
6 Jan 2006 7:53 PM
LDD
I should have mentioned this is a windows form datagrid

I don't think I can use the PagedDataSource  class

LDD

Show quoteHide quote
"Marina" <someone@nospam.com> wrote in message
news:eoHGJmvEGHA.648@TK2MSFTNGP14.phx.gbl...
> Take a look at the PagedDataSource class. It can do the paging for you,
and
> you can use a DataView to filter/sort. So point the PagedDataSource to
your
> filtered/sorted DataView, and you should be all set.
>
> "LDD" <largedoubledou***@gmail.com> wrote in message
> news:z8KdnQrUs4i8WyPenZ2dnUVZ_v6dnZ2d@magma.ca...
> > Hi Folks
> >
> > I'm trying to determine a way to handle paging, filtering and sorting in
a
> > datagrid.
> > If I choose to filter and sort, I'd like to return a subset. If that
> > resultset has more records then the number of rows I'd like to display,
> > I'd
> > like to be able to load pages into the grid.
> >
> > My question is, do I need to continually hit the db to get the next page
> > of
> > records, or is there another method of doing with the dataset. i.e. load
> > the
> > entire resultset into the dataset and pick up the next block of results
as
> > neeeded.
> >
> > thanks folks
> >
> > LDD
> >
> >
>
>
Author
6 Jan 2006 9:21 PM
Marina
You are right, you can't.

You can still do all the filtering/sorting through the dataview.

Are you sure you need paging in a windows application? It is typically not
used since grids are much more functional, and there is no issue with
network latency sending the HTML down to the client.

If you do really need paging, I"m not sure what there is out there for that.
You may have to roll your own.

Show quoteHide quote
"LDD" <largedoubledou***@gmail.com> wrote in message
news:tLOdnY5phbo5VyPeRVn-jQ@magma.ca...
>I should have mentioned this is a windows form datagrid
>
> I don't think I can use the PagedDataSource  class
>
> LDD
>
> "Marina" <someone@nospam.com> wrote in message
> news:eoHGJmvEGHA.648@TK2MSFTNGP14.phx.gbl...
>> Take a look at the PagedDataSource class. It can do the paging for you,
> and
>> you can use a DataView to filter/sort. So point the PagedDataSource to
> your
>> filtered/sorted DataView, and you should be all set.
>>
>> "LDD" <largedoubledou***@gmail.com> wrote in message
>> news:z8KdnQrUs4i8WyPenZ2dnUVZ_v6dnZ2d@magma.ca...
>> > Hi Folks
>> >
>> > I'm trying to determine a way to handle paging, filtering and sorting
>> > in
> a
>> > datagrid.
>> > If I choose to filter and sort, I'd like to return a subset. If that
>> > resultset has more records then the number of rows I'd like to display,
>> > I'd
>> > like to be able to load pages into the grid.
>> >
>> > My question is, do I need to continually hit the db to get the next
>> > page
>> > of
>> > records, or is there another method of doing with the dataset. i.e.
>> > load
>> > the
>> > entire resultset into the dataset and pick up the next block of results
> as
>> > neeeded.
>> >
>> > thanks folks
>> >
>> > LDD
>> >
>> >
>>
>>
>
>
Author
6 Jan 2006 10:22 PM
Cor Ligthert [MVP]
Author
9 Jan 2006 5:59 PM
LDD
thanks for your help folks

The reason I want to use the paging is because of the number of records.
Loading 300k + records can take up some resources.

What I think I'll end up doing is, simply run the modified query each time
against the database, and using the overloaded Fill method for the
dataadapter, only show a chunk at a time in the grid. As the user navigates
through the pages, I'll update the fill method and reflect the changes in
the grid.

I may also set this up with a dataview and compare the performance of the
two approaches.

LDD

Show quoteHide quote
"LDD" <largedoubledou***@gmail.com> wrote in message
news:z8KdnQrUs4i8WyPenZ2dnUVZ_v6dnZ2d@magma.ca...
> Hi Folks
>
> I'm trying to determine a way to handle paging, filtering and sorting in a
> datagrid.
> If I choose to filter and sort, I'd like to return a subset. If that
> resultset has more records then the number of rows I'd like to display,
I'd
> like to be able to load pages into the grid.
>
> My question is, do I need to continually hit the db to get the next page
of
> records, or is there another method of doing with the dataset. i.e. load
the
> entire resultset into the dataset and pick up the next block of results as
> neeeded.
>
> thanks folks
>
> LDD
>
>