I have a hierarchical dataset that is 5 levels. Essentially, levels 2 on up are totaling the child rows. The columns for each level are the same. There is a requirement, based on a user selection, to pick what high level to show. In other words, I may want to show level 5 on down or level 4 on down, etc, or just show level 1. I think I am always going to build the dataset for all 5 levels. What would be your recommendation on binding the selection to a grid? Do I create other datasets based on the top level selected that are clones of the 5 level dataset, or can you specify a subset of the 5 level dataset to bind to the grid? Should the dataset relations be recursive or parent-child? Also, since the column headers are the same for all levels, is there a way to not display the column headers on any child rows? A rough approximation of the grid would be:
Sales Orders
Year 2013 $$$$ 99999
Spring $$$ 9999
1st Quarter $$$ 999
Jan $$$ 999
Week 1 $$$ 999
Week 2 $$$ 999
Week 3 $$$ 999
Week 4 $$$ 999
But I may only want to display 1st Quarter on down or Jan on down etc.
Thanks,
Ron
Hello Ron,
You could take a look at the 'MaxBandDepth' property on the layout of the 'UltraGrid' control:
http://help.infragistics.com/NetAdvantage/WinForms/2012.2/CLR4.0/?page=Infragistics4.Win.UltraWinGrid.v12.2~Infragistics.Win.UltraWinGrid.UltraGridLayout~MaxBandDepth.html.
You could also use the 'DataMember' property and set it to level3's datatable:
http://help.infragistics.com/NetAdvantage/WinForms/2012.2/CLR4.0/?page=Infragistics4.Win.UltraWinGrid.v12.2~Infragistics.Win.UltraWinGrid.UltraGridBase~DataMember.html.
Please feel free to let me know if I misunderstood you or if you have any other questions.
What about not displaying the column headers on child bands?
Ron,
You could use the following code for it:
...Layout.Bands[0].ColHeadersVisible = false;
I used the ColHeadersVisible = false on all child bands and it works, but I also only want the column headers on Band[0] for the first row only. All the columns are the same for all bands. Is there a way to accomplish this?
I tried your suggestion and yes the layout was being overriden after I had applied my property settings. Moved the grid properties modifications to a subsequently executed method
and everything is working now. Thanks for your help.
Hi,
If the property is not working at all, then my guess is that something else in your code is overwriting the property setting. Put a button on the form and in the Click event of that button, display the InterBandSpacing property and see if it is still set to what you set it to. If not, then your code is re-setting it somewhere, either by directly setting the property or by loading a Layout or a Preset.
In the grid_InitiailizeLayout event, I tried both e.layout.InterBandSpacing = 0 and grid.DisplayLayout.InterBandSpacing = 0. Neither did anything, I set the spacing to 50 and it still looks like the default of 5. Does setting the headers to invisible have something to do with it or the row connectpors which I would like to get rid of?
Hi Ron,
It sounds like you are looking for the InterbandSpacing property on the Override. That will remove the vertical space between bands.
Using both properties is what I needed so that works fine. Now I want to get rid of the space between all rows even across bands and the row connector lines but still leave the + - Expand characters. Is that possible?