Hi,
i have an xamGrid in which i am assigning itemsSource to a customized datatable class that we created (contains columns, rows, dataview ...)
in my case the grid columns are dynamic. i can add and remove columns
when i change the itemsSource, i save the layout of the Grid using the persistence manager then i reload it when i change the itemsSource.
the added columns appear for a second then disappear when i reload the layout.
when i debug i find that the grid contains 3 columns while the itemsSource contains 5 items.
i thought i had a solution by saving each column's layout and reload it. but the layout is not reload it well (sorting, conditional formatting ...) while when saving the grid's layout, the layout is loaded but the columns are disappearing
please advise
sorry i did a mistake.
it's _P_PersistenceSettings.IgnorePropertySettings.Add(p);
now the columns are not disappearing, but most of the layout is not loaded.
like sorting , conditional formatting,
while other layout is loading like column width
PropertyNamePersistenceInfo p = new PropertyNamePersistenceInfo();
p.PropertyName = "Columns";
_P_PersistenceSettings.PropertySettings.Add(p);
_P_PersistenceSettings.SavePersistenceOptions = Infragistics.Persistence.Primitives.PersistenceOption.AllButIgnored;
_P_PersistenceSettings.LoadPersistenceOptions = Infragistics.Persistence.Primitives.PersistenceOption.AllButIgnored;
PersistenceManager.SetSettings(xamGrid1, _P_PersistenceSettings);
i did that but still the columns are disappearing when loading the grid layout.
and the columns layout is not kept (sorting, conditional formatting...)
What you're seeing is actually by design.
The xamGrid is reloading the specified persistence. When it comes to collections, it matches them. Meaning you saved it with 3 columns, so when you load, you're going to get 3 columns back.
If you really wanted to keep the columns, i suppose what you could do is Ignore the Columns property.
Then save off each column separately and reload it separately .
-SteveZ
hi,
i tried a new sample that works like this:
i have 2 classes:
testData have properties: Key,Col1,Col2
testData1 class have properties: Key,Col1,Col2,Col3
i made a list of testData give it to the xamGrid as ItemsSource
Save Layout
Change itemsSource to a list of testData1
Reload layout
by doing that Col3 will disappear.
i tried changing the name of the properties in testdata1 and found that the properties that do not exist in testdata will disappear.
is there a way to avoid this? like keeping the new columns?
regards
Do you think you can post a sample that demonstrates the issue?