|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Paging, Filtering and SortingHi 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 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 > > 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 > > > > > > 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 >> > >> > >> >> > > LDD,
Have a look at this one http://www.vb-tips.com/default.aspx?ID=79afdb6a-611d-43cd-9186-def86a1baeef I hope this helps, Cor 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 > >
Armin - Start sound problem revived in new thread
Use of delegate SetWindowsHookEx and VB.NET 2005 A Framework for Datadriven Forms for VB Dot Net XML Comments File Generated Byte Array, Datagrid Simple Example of How to Implement SerialPort Class Add a line break in label.text populating text boxes... Help w/ 1st File Access Program |
|||||||||||||||||||||||