I am using UltraWinGrid2007 Vol3 and am trying to use a hierarchical dataset at design time and have run into some problems such as non-responsive applications (for over 30 minutes) and/or error messages which may prevent me from seeing the form layout.
In my dataset are two tables with the following (simplified) structure:
Table: PlanPlanId (PK)PlanDescriptionEffectiveDate
Table: Tree TreeId (PK)TreeId_Parent (FK to Tree.TreeId)PlanId (FK to Plan.PlanId)TreeDescriptionAmount
I plop a grid control on my form which starts the wizard. I bind the control to my project dataset's Plan table and click the Finish button.
The screen seems to hang but if I leave it alone for 30 to 60 minutes I may either get an error message which will prevent me from viewing the form or it might show the form and my first field will be a col width of 2000 and I cannot change it.
It seems to be creating 99 Bands in my grid. From reading the other posts on this forum the recommended solution is to set the grid.displaylayout.maxbanddepth = some value (for my purposes 5 was enough). The next problem was that this property needs to be set before the wizard takes off so I did the following:
I created a new class called UltraGrid_Ex.vb containing the following code:
Public Class UltraGrid_Ex Inherits Infragistics.Win.UltraWinGrid.UltraGrid Public Sub New() MyBase.DisplayLayout.MaxBandDepth = 5 End SubEnd Class
I compiled (a few times) and (eventually) I could see my new class and I could drag it to my form.
The wizard appeared and I told it to use my project's dataset's Plan table.
It still created the 99 bands but when I clicked Finish it only took a couple seconds before it finished and I did indeed only have 5 bands after all.
Is there a fix for this problem or will I need to keep this solution?
Thanks
You could close the wizard, set MaxBandDepth on the grid, then set the grid's DataSource in the designer.