I have a functionality wherein I save the layout files in database as xml and then user can change the layouts at the run time. This is basically to hide / unhide many columns and user can have many views of the grid.
Now suppose the layout1 saved in database has 5 columns. Later on we added 2 more columns to the grid. These 2 new columns are not present in the layout1 that is saved. Now when we load the layout1, these 2 columns are visible although they are not present in the xml file (I checked that). So basically, i guess if the columns are not present in the layout file, by default the grid control makes them visible.
Is there a way to fix this?
One idea would be to try setting DisplayLayout.NewColumnLoadStyle to Hide, though I'm not completely sure whether this applies to layouts or not.
-Matt
This does not work in case of scenario i expalined. Any thoughts on how can it be done. I definately do not want to read the xml file for this.
You don't have to read the XML. What you could do is load the Layout into a Layout variable in code and examine the bands and columns. You could then determine which columns do not exist in the layout and hide the ones that are in the grid but not in the layout you loaded.
Thanks a lot. Looks like it will work.