Hello,
I need to have 2 bands for my ultraWinGrid layout. In UltraGrid designer I added band[1] as a child for band[0]. I put ViewStyle property to MultiBand. But on InitializeLayout event I have only one band in e.Layout.Bands collection. What should I add in order to get the second band? (and I need to create the second band at design time, not at run time).
Thank you
Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("Band 1");
Infragistics.Win.UltraWinGrid.UltraGridBand ultraGridBand2 = new Infragistics.Win.UltraWinGrid.UltraGridBand("Band 1", 0);
this.ugRC.DataSource = this.ultraDataSource1;
ultraGridBand2.MinRows = 1;
this.ugRC.DisplayLayout.BandsSerializer.Add(ultraGridBand2);
this.ugRC.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.Yes;
this.ugRC.InitializeLayout += new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(this.ugRC_InitializeLayout);
It's hard to say what's going on here as there's not much to go on. You should probably submit a sample to Developer Support.
-Matt
I am using ultrawindatasource for my hieachical grid, and the reason for using the grid is that I need to be able to merge columns.
The problem I am experiencing is that the last row that I have added doesn't appear in the grid, everything else appears perfectly.
Sorry I mispoke, the rows appear, but the contents and columns are non-existent.
However I am stepping throught the code to add them.
Any ideas?
Hi Steve,
The grid cannot display sibling bands at the root level. You can have sibling child bands. So one row in the grid can display multiple sets of child bands from different tables. But the root level of the grid can only have a single data source.
So you have a couple of options. You could create another table in your DataSet with two rows and then arrange it such that all of the rows in Parent_Table are under one row and all of the rows in Other_Table are under the other row.
Another option would be to use UltraWinTree instead of UltraWinGrid. The tree lacks some of the features of the grid, like summaries and filtering. But it's a little more flexible in terms of the data structure. You would still need two rows (nodes) at the root level to divide up the Parent_Table and Other_Table data. But these rows would not need to be part of the data structure, you could just add a couple of nodes to the tree and then bind their child nodes to different tables.
I have a question about binding multiple bands to a wingrid.
I have the following data structure:
3 bands of data (datatables within a dataset really) all with the exact same columns. For simplicity, I'll call them Parent_Band, Child_Band and Other_Band. As you might guess, the Child_Band is a sub-band of the Parent_Band. I established a data relation within my dataset between these two tables, and they are displaying properly when the dataset is bound to the grid. The parent rows are displaying and have expansion indicators if there are child rows. The child rows are displayed beneath the appropriate parent row.
My problem is that I want to then display all the rows from the Other_Band at the bottom of the grid. Although, this band has the same columns, it should have no "relation" to the other bands and the rows should display as "peers" of the Parent Band. They would never have a child band.
I attempted to accomplish this by adding a third table to the dataset and hoping that they would show up somewhere in the grid, but the records from the Other_Band don't display at all. The other bands continue to display correctly.
Any advice would be greatly appreciated.
Thanks so much,
Steve
Well, I'm not entirely sure if there are samples that add bands to the UltraDataSource in code. But if there are, they would be in th sample folder under UltraDataSource.
You could set up your UltraDataSource at design-time using the designer if you want. That might be easier.
The code isn't very complicated, though. There's a Band property on the UltraDataSource that represents the root band. You can add columns via the Columns collection and child bands via the ChildBands collection.