Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » GridCtrl large data set from DB
Re: GridCtrl large data set from DB [message #25328 is a reply to message #25324] Wed, 17 February 2010 12:06 Go to previous messageGo to previous message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Current GridCtrl's search algorithm is indeed slow. I can improve that, but it won't solve your problem anyway. If your database table size grows constantly no matter how searching implementation efficient will be some day you'll hit the wall. And filling grid with data will be taking more and more time as well as memory space. Another thing worth mentioning here is that users are mostly interested in new/fresh data, so loading everything to the memory is in most cases unnecessary.
In my application I use paging control (see the screen-shot). I wrote it myself and if you want I can publish it (but first I need to separate it from my project and write simple example for it). If any button or arrow is pressed I simply generate new query to database that returns a proper result range. Basically this is the same query used to load all data with offset/limit instructions added. Most databases support them. Also if you need sorting you must do it by changing the database query otherwise you will sort only visible part of data and consistency with paging will be lost.
So as you can see I'm doing the same what you were thinking of.
Other solution is to use virtual rows (but GridCtrl doesn't support them) and to load data on the fly as one moves the scrollbar. But that needs some smart cashing strategy, otherwise scrolling experience will be bad. It's very nice solved in xceed grid - http://xceed.com/Grid_WPF_Intro.html. Just run the demo. Maybe I'll add something similar to GridCtrl one day Smile
And of course grid searching will be working on loaded data only (for current page). You have to provide your own searching method to search all database data.
index.php?t=getfile&id=2295&private=0
  • Attachment: pager.png
    (Size: 4.05KB, Downloaded 776 times)

[Updated on: Wed, 17 February 2010 12:09]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Cells appearance and text alignment
Next Topic: Calculate needed cell width to fit some text
Goto Forum:
  


Current Time: Mon May 20 05:33:48 CEST 2024

Total time taken to generate the page: 0.00585 seconds