Hi,
We are using Infragistics version 9.2.
Scenario:
Question:
Is there a way for the grid to pick up the formatting for the new columns when MyWinApp v1.0 is upgraded to v1.1?
Please feel free to ask any further questions to clarify this problem further.
TIA,
Okash
Hi Okash,
I'm a tiny bit confused about what is happening in step 4. If you saved a layout in v1.0 of your application where the two new columns did not exist, and then you load that layout into a new version of your application where the two columns do exist, then what will happen is that those two columns will lose any property settings you may have applied to them. Since they don't exist in the layout, they will be reset to their default state.
The only real way to get around that is to have a way, in your code, to set the properties on those two columns. In other words, don't set up the properties of these two columns at design-time, you will need to do it run-time.
Once you do that, it leaves you with the problem of how to know if you should set the default settings on these two columns or not. You want to do this the first time the user loads the application, but you don't want to do it again after they have run MyWinApp 1.1 and saved a new layout.
There are a couple of different ways you can go about detecting this. One way I've done it in the past is that I have saved extra information into the layout file. The Layout can be saved to a stream, so you could add in some extra information in the beginning of the stream that indicates the version of the application that the layout was saved with.
Another alternative, which is a little easier to code, is to load the Layout into an UltraGridLayout variable instead of loading it into the grid directly. The idea is that you create an UltraGridLayout object and call it's Load method to load in the layout. Then you can examine the layout and see if the two new columns exist. Whether they exist or not, you use the grid.DisplayLayout.CopyFrom method to copy the loaded layout into the grid. Then you initialize the two new columns if needed - that is, if the two new columns did NOT exist in the layout.
Hi Mike
You are right about step 4.
That should solve the problem. I will try it out and get back if there are any issues. Thanks for the prompt reply. Appreciate your help!