My team is working on a project for a windows application using infragistics 10.1. The previous application had thousands of saved layouts which the users could use to change the arrangement of data in the grid. With the update the columns in the database are changing and data access is occurring differently to where more columns will be being bound than the previous application.
We need to migrate the layouts so the users do not have to create all new ones. Our initial thought was to just load the layout, find the changed columns and update the key. This seems to work but we continue to run into issues. It seems for one that the new columns are displayed by default, so if the layout does not contain the column it shows up and the user sees many more columns than they originally would have. Is there a setting or something that could be used to hide anything from the users that is not found in the layout when applied? We've attempted iterating through and adding then hiding the columns from the layouts but as we dig deeper and deeper the layouts continue to not match.
What type of approach should be taken to convert layouts? I'm hoping some advice can be given that we have overlooked. Thank you for any help you may be able to provide.
Just to add to this. A big problem we are having right now is ordering. It seems as though the column order from the updated layout is out of whack with the original order. Is the order not stored in the layout? What would cause this to get out of sync?
Hi,
I'm not sure I quite understand all the complexities of what you are trying to do, but I can offer you a couple of suggestions that might help point you in the right direction.
First, there is a property on the grid's DisplayLayout called NewColumnLoadStyle which determines what happens when you bind the grid to a data source when the grid already have a layout loaded. So setting this to Hide may help you hide the new columns you don't want the user to see.
If you need finer control than that, then there is another approach you can take that you may not be aware of. You can load a layout from a file into an UltraGridLayout variable instead of loading it directly into the grid.
UltraGridLayout loadedLayout = new UltraGridLayout();loadedLayout.Load(filename);
So this gives you the opportunity to examine the layout and even modify the bands and columns before applying this layout to the grid, which you would do like this:
this.ultraGrid1.DisplayLayout.CopyFrom(loadedLayout);
So that might help you keep everything straight when translating one layout to another.