Hi,
i am using InfragisticsWPF4.v11.2 in my application.
i have use xamgrid in my application. i have use PersistenceManger to save the user preferences. After i loading my xamgrid from persistenceManager contextmenu click is not working. i have use MVVM pattern in my application
xaml Code
<ContextMenu x:Key="DataGridRoiSummaryContextMenu"> <MenuItem Header="Update Prediction For Selection" Command="{Binding MenuCommand, Converter={StaticResource NotConverter}}" CommandParameter="UpdatePredictionForSelection" IsEnabled="{Binding HasUpdatePredictionRights}" > </MenuItem> <MenuItem Header="Clear Prediction For Selection" Command="{Binding MenuCommand}" CommandParameter="ClearPredictionForSelection" IsEnabled="{Binding HasUpdatePredictionRights}"> </MenuItem> <Separator/> <MenuItem Header="Reset Column Order to Default" Command="{Binding MenuCommand}" CommandParameter="ResetColumnOrdertoDefault"> </MenuItem> </ContextMenu>
Code Behind
MemoryStream memoryStream;
memoryStream = PersistenceManager.Save(DataGridRoiSummary);
PersistenceManager.Load(DataGridRoiSummary, memorystreamobject);
can you please help me
Hello,
I have created a sample project for you which persists the Properties you want. The settings are applied only to the "Name" and "Status" columns. Please let me know if this helps you or you need further assistance on this matter.
Looking forward to hear from you.
Hi Stephan.
What PersistenceSettings would I have to use to ONLY serialize/deserialize the following column related properties?
For example, a configuration like the following will save more than just the column width properties:
<ig:PropertyNamePersistenceInfo PropertyName="Width"/>
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Ideally, I would like to only save the following properties:
Unfortunately, I am not familiar enough with the XamGrid + PropertyNamePersistenceInfo to be able to do this.
Although the configuration below is a hack... it does work!
PERSISTENCE MANAGER
<ig:PersistenceSettings SavePersistenceOptions="OnlySpecified" LoadPersistenceOptions="OnlySpecified"> <ig:PersistenceSettings.IgnorePropertySettings> <ig:PropertyNamePersistenceInfo PropertyName="ContextMenu"/> </ig:PersistenceSettings.IgnorePropertySettings> <ig:PersistenceSettings.PropertySettings> <ig:PropertyNamePersistenceInfo PropertyName="Width"/> <ig:PropertyNamePersistenceInfo PropertyName="Visibility"/> <ig:PropertyNamePersistenceInfo PropertyName="SortingSettings"/> </ig:PersistenceSettings.PropertySettings> <ig:PersistenceSettings.Events> <ig:PersistenceEvents PersistenceLoaded="XamGrid_PersistenceLoaded"/> </ig:PersistenceSettings.Events> </ig:PersistenceSettings> </ig:PersistenceManager.Settings>
Full disclosure, I actually tested this configuration via the WPF code behind:
PersistenceSettings settings = new PersistenceSettings(); settings.SavePersistenceOptions = PersistenceOption.OnlySpecified; settings.LoadPersistenceOptions = PersistenceOption.OnlySpecified;
settings.IgnorePropertySettings.Add(new PropertyNamePersistenceInfo() { PropertyName = "ContextMenu" });
settings.PropertySettings.Add(new PropertyNamePersistenceInfo() { PropertyName = "Width" }); settings.PropertySettings.Add(new PropertyNamePersistenceInfo() { PropertyName = "Visibility" }); settings.PropertySettings.Add(new PropertyNamePersistenceInfo() { PropertyName = "SortingSettings" });
not so much
;)