473,396 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Paging, Filtering and Sorting

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
Jan 6 '06 #1
5 1889
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" <la***************@gmail.com> wrote in message
news:z8******************************@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

Jan 6 '06 #2
LDD
I should have mentioned this is a windows form datagrid

I don't think I can use the PagedDataSource class

LDD

"Marina" <so*****@nospam.com> wrote in message
news:eo*************@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" <la***************@gmail.com> wrote in message
news:z8******************************@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


Jan 6 '06 #3
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.

"LDD" <la***************@gmail.com> wrote in message
news:tL********************@magma.ca...
I should have mentioned this is a windows form datagrid

I don't think I can use the PagedDataSource class

LDD

"Marina" <so*****@nospam.com> wrote in message
news:eo*************@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" <la***************@gmail.com> wrote in message
news:z8******************************@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
>
>



Jan 6 '06 #4
LDD,

Have a look at this one

http://www.vb-tips.com/default.aspx?...6-def86a1baeef

I hope this helps,

Cor
Jan 6 '06 #5
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

"LDD" <la***************@gmail.com> wrote in message
news:z8******************************@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

Jan 9 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Martin Feuersteiner | last post by:
Dear Group A while ago I've asked how paging is possible and have read the articles on aspfaq.com. Great work, esp. the speed comparison of all the different techniques. Thank you to everyone...
1
by: Dave S | last post by:
Hi, I'm using a datagrid to display contents of a dataset and I've set the datagrid to allow paging and sorting. Rather than re-retrieve from the DB, I store the original dataset in a Session...
0
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update...
2
by: Hajime Kusakabe | last post by:
Hi. I have created a datagrid (datagrid1) without any columns on a aspx page. Then aspx.vb adds columns from a database. It is somthing like this .... ================================== Dim...
1
by: Guoqi Zheng | last post by:
Sir, The default paging of datagrid is somehow use too much resource, so I am using Stored procedure for the paging. You can find my Stored procedure at the end of this message. It works...
2
by: Kuldeep | last post by:
Hi All, I have been trying to find some algorithms for datagrid sorting and paging. Please help Regards Kuldeep
0
by: anonieko | last post by:
This approach I found very efficient and FAST when compared to the rowcount, or Subquery Approaches. This is before the advent of a ranking function from DB such as ROW_NUMBER() in SQL Server...
3
by: nyhetsgrupper | last post by:
Hi everyone, In a datagrid the entire data is read but only the page you want is displayed to the user when you enable paging. Does the Gridview control works in the same way? So if you have...
1
by: John A Grandy | last post by:
In regard to a GridView that must support searching, filtering, sorting, and paging ... There is a tradeoff in performing the sorting and paging in the database versus to creating a CLR sort...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.