Hi,
I'm having a little trouble understanding using the UltraDataSource in conjunction with the UltraGrid to pull data out of a DB. I've been looking at the million rows sample, but it doesnt really deal with using a DB.
Basically, I have (currently) an SQLDataAdapter retrieving data from the DB, and dropping it all into a DS. The UGrid is bound to this DS, and is displaying the details. Unfortunately, this particular query is returning upwards of 50K rows, and so is freezing the application during loading (understandably).
I've toyed with putting in a manual dropdown filter to reduce the number of records, but its conceivable that they would need to have all the rows, since we make use of the Outlook groupBy feature, as well as the column filtering feature. I actually suspect that we cant use the loadondemand setup if we are also using these two features, but im not entirely sure on that one.
Having a look at it in a bit more detail, it seems like the system is freezing on the sda fill event, so im not even sure if using this method will work, but can anyone give me some guidance on how to use the UltraDS for this sort of thing? I'd also prefer to not have to manually enter the column names if at all possible.
Can anyone help?
Thanks
Fergal
Hi Fergal,
fergal1982 said:I've toyed with putting in a manual dropdown filter to reduce the number of records, but its conceivable that they would need to have all the rows, since we make use of the Outlook groupBy feature, as well as the column filtering feature. I actually suspect that we cant use the loadondemand setup if we are also using these two features, but im not entirely sure on that one.
This is essentially correct. You could still use OnDemand, but as soon as the user groups or filters, the grid would load all of the row, thus defeating any benefit of loading on demand.
Damn. I suspected as much.
Assuming we stop using these features, can you guide me in setting it up? I have a few other areas where it would be beneficial to use.
I'm not sure how I can help. Basically, the Million Rows sample shows you hot the grid and UltraDataSource do loading on demand. Obviously, this is just a sample, so it creates random, meaningless data. It's up to you to work out how to load data into your data source on-demand. I don't think DataSets/DataTables are really useful for this, actually. They don't seem to be set up to load data on demand. You may need to write your own custom data object or maybe investigate some other data sources.
I can help if you have questions about the grid or the UltraDataSource, but the back end is really not my area of expertise.
no problem. I've had a bit more of a play, and think I may have some idea of what to do. Couple of questions though:
1. Is it possible to load the schema from a Dataset table into the UltraDatasource?
2. This isnt really a DataSource issue, but is it possible to override the grouby action in any way? Since when you select a column to group by, it goes and pulls all the data from the query, I was wondering if its possible to override the generation of the groups lists. If you can, then you could use a more sreamlined query to retrieve the relevant data for the specifically selected column.
no problem. I was hoping that maybe I could override how it grouped, so that I was only pulling out a few rows of the database to create the rows. Never mind.
I've decided to take the preload hit (for now, I my use external filters to reduce the number of records), and move the query into a backgroundworker (which has brought on its own problems - the controls dont seem to be liking me much at the moment it seems).
1. There's no automatic way, no. You could write code to do this, of course.
2. No, there is no way to do this. Grouping will require the grid to load all of the data, anyway, so this would defeat any benefit of loading on demand.