I'm attempting to upgrade my code from Infragistics 8.3 to 9.1. In 8.3, clearing a data source's child band would also clear all child bands in the grid it's attached to. In 9.1, it appears to only clear the immediate child band, and the grand child becomes the child of the root. Is this expected behavior? Or is there another way to clear the children?
Thanks.
-Nick
Hi Nick,
What you are describing does not seem possible. The grid gets it's structure from the data source. If you are saying that the clearing of the child band is somehow creating a relationship between the parent band and the grandchild band then the data source must be doing this, there's no way it can possibly be done by the grid. Unless something is seriously wrong.
In order to reproduce this, create a new windows project, and drop an ultragrid and an ultradatasource onto a form. Tell the grid you'll bind the schema at runtime. Then create the method:
private void SetupGrid(){ ultraGrid1.DataSource = ultraDataSource1; ultraDataSource1.Band.Key = "Totals"; ultraDataSource1.Band.Columns.Clear(); ultraDataSource1.Band.ChildBands.Clear(); ultraDataSource1.Band.Columns.Add("Totals", typeof(string)); UltraDataBand band = ultraDataSource1.Band; int index = 1; for(int i = 0; i < 2; ++i, ++index) { string nameToUse = "col" + i.ToString(); UltraDataBand childBand = band.ChildBands.Add(nameToUse); childBand.Columns.Clear(); childBand.Columns.Add(nameToUse, typeof(string)); //m_bands.Add(childBand); ultraGrid1.DisplayLayout.Bands[index].Override.FixedRowStyle = FixedRowStyle.Top; ultraGrid1.DisplayLayout.Bands[index].ColHeadersVisible = false; ultraGrid1.DisplayLayout.Bands[index].Columns[nameToUse].ColSpan = 1; band = childBand; }}
In your constructor, call SetupGrid twice and it will crash on the second call of the function when it attempts to set ColSpan to 1 because it can't find the column. This works fine in 8.2 and 8.3.