Hello,
I've attached a sample solution in which i have a ultragrid linked to a dataset.
Dataset has 3 tables, "One", "Two" and "Three". "Two" and "Three" being child of "One" and sibling of each other.
On the click of the button "Replace Band Three", I remove table "Three" from the dataset and add another table "Three" with a different structure.
How can this change be reflected into the grid, can I reload the display layout of a band ?
TIA,
Guillaume.
If you consider the object model the grid is sitting there and hasn't realized that its underlying data source has been modified. I looked around and didn't see any methods that suggested something that would refresh a specific band or anything of that nature. I would bet that if you were to set the grid's data source equal to your data source object again in your button click event that the grid would reorganize itself to match the new table structure.
If re-setting the DataSource is the only way, i will have to use that way.
However, I have problem making it work.
Setting again the DataSource to the dataset does not work.
Setting the DataSource to null, then to the dataset, show new band but it has no columns (I see only row markers).
Setting the DataSource to a copy of the dataset works ok. However, I don't want the overhead of creating a copy of the dataset.
I would have preferred not to re-set the grid datasource, to preserve grid "state" ie : scroll position, row expanded, sorting, ... for other bands.