Is there a way to simulate bands with the wingrid.I have a datatable with a recursive relationship. The problem is that the WinGrid can only display up to 100 bands and the data table may have more levels than this.Do you have any suggestions for handling this issue?
Thank you,Seradex
Hi Seradex,
The grid limits the data to 100 bands because of the MaxBandDepth property. So if you need to show more data than that, you can simply set MaxBandDepth to a higher number (although there is always a limit - there's no way to have infinite bands).
However, please note that this will not work very well in many cases. In my experience, the BindingManager in DotNet can't handle anywhere close to 100 bands. In fact, you will probably start experiencing severe performance problems at between 5 and 8 levels of hierarchy, depending on your data source.
In reality, no human user could possibly work effectively with much more depth than that, anyway.
If you don't need filtering, summaries, or exporting, you might consider using the UltraWinTree instead of the UltraWinGrid. The tree loads the data more efficiently on-demand. So it doesn't create all of the BindingManagers up front like the grid does. You will probably still run into performance problems using the tree, but they won't happen until the user actually drills down into the data.
Does the UltraWinTree support multiple columns of information? I didn't think it did.
The purpose of the tool that is being written is to track shipped inventory data back to their source through many changes including producing items from other items (many to one scenario).
Going that number of levels may not happen often, but I would like to try to eliminate this as a potential problem. My DataSource is a single datatable with approximately 5 columns of data. It is unlikely that this datatable will have thousands of rows of data. Most likely 2 to 200 rows at the most. Note that as I mentioned previously that this is a datatable with a recursive relationship. Also, the grid's top band would only display the items that have no "parents".
Note that I have tried setting the MaxBandDepth to greater than 100 at design time and it keeps telling me that this is not a valid value.
I appreciate your help with this.
I just looked at the UltraWinTree. I am more familiar with the Microsoft TreeView control where you cannot have multiple columns.
I will look into this as a possible solution for my issue.The only concern I have is an issue I had with the UltraGrid control. When Override.AllowColSizing = Infragistics.Win.UltraWinGrid.AllowColSizing.Synchronized The first column was extremely wide when the MaxBandDepth was 100 (greater than the width of the screen). Hopefully I will not have the same issue with using the UltraWinTree.
P.S. I have heard before that the MaxBandDepth could be set to more than 100, but, since this cannot be done in design mode, I thought it was a mistake. Can you clarify this?
Any other insights or assistance you can provide would be greatly appreciated. (Net Advantage 13.1)
Thank you for your help.
Seradex
seradex said:Does the UltraWinTree support multiple columns of information? I didn't think it did.
Yes, it does. If you bind the tree, it will automatically create columns for you in much the same way the grid does.
seradex said:I will look into this as a possible solution for my issue.The only concern I have is an issue I had with the UltraGrid control. When Override.AllowColSizing = Infragistics.Win.UltraWinGrid.AllowColSizing.Synchronized The first column was extremely wide when the MaxBandDepth was 100 (greater than the width of the screen). Hopefully I will not have the same issue with using the UltraWinTree.
That's because each band in the grid is indented a little bit more. So when the columns are synchronized, the first band in column 0 is aligned with the first band in column 100 and sine each column is intended, the first columns become huge. the solution to this is simple. Either don't synchronize the columns or set the Indentation on each band to 0.
seradex said: I have heard before that the MaxBandDepth could be set to more than 100, but, since this cannot be done in design mode, I thought it was a mistake. Can you clarify this?
Sorry, I didn't realize there was a limit on the property. Apparently, it will not accept a value greater than 100. I'm not sure why. That seems like a pretty arbitrary limitation. But like I mentioned previously, anything more than 8 bands is pretty much going to lock up the application, anyway. The DotNet BindingManager simply cannot handle that much depth.
The tree is a little better since it's more efficient and doesn't load the data until the nodes are expanded. But even so, I doubt you will ever be able to get to 100 levels. That's just not realistic in a DotNet Winforms application in my experience.
I am sorry I wasn't clear about my previous post.
I meant to say that I was concerned about having the same behaviour with the UltraWinTree that I get with the UltraGrid with a large # of bands and Override.AllowColSizing = Infragistics.Win.UltraWinGrid.AllowColSizing.Synchronized.
Do we have any control over how that works, or can the first column scroll independently of the remaining columns, or is there some other thing about it that would allow it to work well?
Either way, I do appreciate your assistance and think that using the UltraWinTree appears to be my best option.
Hopefully I can get it to partially autoexpand like I can with the UltraGrid.
I added code to do that, but it was just testing code so it contains dummy data:
Private Sub UltraGrid1_AfterRowExpanded(sender As Object, e As Infragistics.Win.UltraWinGrid.RowEventArgs) Handles UltraGrid1.AfterRowExpanded For Each Row In e.Row.ChildBands(0).Rows If Row.Cells("OwnerTypeID").Value = 1 Then If Row.ChildBands(0).Rows.Count = 0 Then Row.Expanded = False Row.ExpansionIndicator = Infragistics.Win.UltraWinGrid.ShowExpansionIndicator.CheckOnExpand End If End If Next End Sub
Private Sub UltraGrid1_BeforeRowExpanded(sender As Object, e As Infragistics.Win.UltraWinGrid.CancelableRowEventArgs) Handles UltraGrid1.BeforeRowExpanded If e.Row.Cells("OwnerTypeID").Value = 1 Then If e.Row.ChildBands(0).Rows.Count = 0 Then If AutoExpand Then e.Cancel = True Else Me.ItemTrackingData.CostTracking.AddCostTrackingRow(2, "Receiving", "RC140106", 1, "Received", "xyz", "", "", 1, 1, CType(e.Row.ListObject, DataRowView).Row, 0, 0) End If End If End If End Sub
Am I able to do this type of thing with the UltraWinTree in 13.1? (Hopefully yes)
I appreciate all of your help with this.
Hello,
I am just checking about the progress of this issue. Let me know If you need our further assistance on this issue?
Thank you for using Infragistics Components.
Off the top of my head, I'm not as familiar with the tree as I am with the grid. Are the tree columns synchronized, by default? I wouldn't think so, but the node are, of course, indented. And with a recursive data source, the tree will end up using the same ColumnSet for every band, so the columns width woulds all be the same.
I ran the old UltraWinTree DataBinding (Recursive) sample and switch it to Grid mode and it seems like the columns widths do not increase like they would in the grid.
Regarding your second question about partially expanded the rows, I don't think I understand what you are asking. You can example the nodes in the tree, of course and there are events for before and after (BeforeExpand, AfterExpand).