Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Determine which Columns of a Grid have been loaded with DisplayLayout.Load()
posted

hi!

Is there a chance to find out which columns in a grid have been loaded with the DisplayLayout.Load(MemoryStream ms) method and which columns have not?

Imagine the following situation:

Version 1 of the program:

select a,b from table

Columns in the Grid: A, B

The user saves this DisplayLayout

-------

Version 2 of the program:

select a,b,c from table

The user loads the existing DisplayLayout from the database.

Now, only columns A and B should be displayed and C should be hidden.

By default, all three columns are displayed in the grid - i want to hide column C. How can i find out that only A and B have a stored DisplayLayout?

Thank you in advance!

 

Regards,

 

Andi

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Yes. Instead of loading the layout into the grid's DisplayLayout, create an UltraGridLayout variable and load the layout into that. You can then examine the columns and bands in the layout. If you decide to load the layout into the grid, you can load it directly from the variable, rather than loading it from a file again, by using grid.DisplayLayout.CopyFrom.

Children