I've got a grid that is bound to a hierachal dataset during runtime and I have defined two custom row layouts for each of the two levels within the dataset. The custom layouts look the way I want during design time but after setting the datasource at runtime I'm not getting the proper results. Both layouts do not retain the custom header captions defined during design time. Only the first levels layout is remotely close to what it should be while the second level's layout is completely reset to the default look/layout. I'm using the 6.3 version from 2007.
I defined the schema manually and set the captions for most of the columns. I chose the "Set during run time" option after closing the define schema dialog. I've already confirmed that the column names during runtime match 100% with that of the columns I defined during design time. I've confirmed that the ViewStyle is set to MultiBand.
Here is the design time showing proper layout:
Here is runtime:
Any suggestions to resolve this?
I've think I've run across a possible fix/root cause for the first band? The name of the DataTable within the dataset must match the key given to the UltraGridBand during design time. In my first band the key is called "Cases". This however is not working for the second band so I must not have a property set somewhere to allow custom row layouts for each band. Continuing to look...
Before (not working):
DataTable level0 = heirarchyDs.Tables.Add("level0");
After (working):
DataTable
level0 = heirarchyDs.Tables.Add("Cases");
You are correct. The names (keys) of the Bands have to match up to the data source. If you are binding the grid to a DataSet, then the key of the child band is the key of the Relationship, not the child table.
One way to be sure is to simply examine the grid.DisplayLayout.Bands[1].Key property at run-time. Then use the same key for your schema at design-time.
That worked. Here is the code for the second DataTable in my DataSet for my DataRelation that I've named to match my band's key from design time. Also, I don't think I've seen this key information in the documentation even for the latest version.
heirarchyDs.Tables[1].TableName =
"Interactions";
I will forward this over to the Docs team and ask them to add this information in the docs.