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
1365
load existing layout when underlying datasource has new columns
posted

Hi, i've been working on this for a while and found some great tips here. But nothing is working .

my problem is:

i have a wingrid bound to bindinglist<T> of a custom DTO. this list is bound to the grid, no problem. i have a saved version of a layout from this grid with all the columns the grid had at the time (i called savelayouttoxml). since then, i have added (only added) new columns to the dto and no matter what i do i always see those columns after i call loadlayoutfromxml. fine, there are new columns the layout doesn't know about it so it shows them. how can i hide them?

i tried hiding all columns before calling loadinglayoutfromxml() but these new columns are always visible. i know they are not in the layout file. even putting the columns at the end of the grid is better than seeing them there. they are right in the front of the grid everytime i add new columns. 

i'm currently using layoutcategories.SortedColumns.

what can i do? i've been bald for 20 years and i think i'm going to start pulling my arm hair out.

thanks in advance