I have read the available post regarding this issue, and none of the suggestion considerably improve performance. I am using many (MANY!) child bands. The child bands are identical in format, and layout. Essentially, my program loops through my file system and groups certain files into individual child bands. This is mostly for usability as having the groups separate visually is very convenient and makes acting on these items very easy.
Performance-wise, this really isn't viable. Is there another mechanism by with I could achieve the same thing? I am new to the whole Databand thing. I've been using Infragistics since around version 4 and am now adapting to the DataBands. Mostly I would like something like the very poor represantation below
The number of Groups and files in each are unknown at runtime and the grid is built dynamically as conditions are met.
+GROUP1
File 1
File 2
File 3
+Group2
+Group 3
File 4
Hi,
It depends on the needs of your application, but if you have a very large number of child bands, then you may not be able to use DataBinding.
In DotNet, each island of data requires a BindingManager, and binding a large number of bands becomes increasingly inefficient exponentially. In my experience anything more than between 5 to 8 levels of data will become unusable due to performance issues.
It's not entirely clear from your post what your data structure is. When you say you have a lot of bands, are you talking about one root band with lots of direct children? Or are you talking about many levels of children, grandchildren, great grandchildren, etc. Typically, it is the depth that causes a problem and not the breadth. One root band can have a coupe of dozen child bands without a problem, but trying to have one band at each level down 5 levels will start to see a decrease in performance.
If you can't get what you want using DataBinding because of performance, than maybe you could consider using the UltraWinTree control instead of the UltraWinGrid and instead of binding it to a data source, copy the data into the tree directly. That should give you much better performance, at the cost of some feature like summaries, printing, filtering, and exporting.
Another possible solution would be to try using UltraDataSource and manually populating it with a copy of your data. The UltraDataSource tends to be more efficient that the DataSet, but DataBinding is still involved, so you might still have a problem.
Thank you for your replay. It is one band with multiple children, but no grandchildren. Actually, I don't even need the parent, just grouped records. Look at the sample below. Each line marked File # should be a line in the grid. The Group# line isn't necessary or wanted, it is just to show you that I want the 3 files in group 1 to be separate from the 2 files in group 2, etc.... The formatting of all the lines are the same.
I am using Ultradatasource, and the data is manually created at runtime, I am not "Binging" to a datasource. I manually add bands to the grid, then row to the band, it's all done in code. I was a heavy user of your controls before the whole databinding and DataSource was really fleshed out and am used to doing things this way.
Here is an example of how I create my UltraDataSource:
Private Sub InitializeWebGrid()
UltraGrid.Datasource = InitializeDataSourceEnd Sub
Private Function InitializeDataSource() As UltraDataSource Dim strRoot As String = GRID_DATA_BAND_ROOT_NAME Dim objDataSource = New UltraDataSource With objDataSource Call .Reset() .AllowDelete = True .Band.Key = strRoot End With Call FormatDataBand_Duplicate(objDataSource.GetBandByKey(strRoot)) Return objDataSource End Function
The most efficient way to do this would be to bind the grid to a flat list of data like a DataTable or UltraDataSource with a single band and no child bands. Assuming that each line of data contains a field that indicates the group, you can then use the OutlookGroupBy feature of the grid to group the data.
Grouping is tightly tied to sorting, so to group the grid in code, you would do something like this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; layout.ViewStyleBand = ViewStyleBand.OutlookGroupBy; band.SortedColumns.Add("GroupNumber", false, true); }