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 Ripal,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
I too have experienced the same problem.
If I deserialize a XamGrid's configuration... the ContextMenu does not load properly.
I suspect that the issue is related to:
PERSISTENCE MANAGER
<ig:PersistenceManager.Settings> <ig:PersistenceSettings SavePersistenceOptions="OnlySpecified" LoadPersistenceOptions="OnlySpecified"> <ig:PersistenceSettings.PropertySettings> <ig:PropertyNamePersistenceInfo PropertyName="Width"/> <!-- save any `width` property... anywhere in the XamGrid object graph... including the menu --> <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>
CONTEXT MENU
<ig:XamGrid.ContextMenu> <ContextMenu> <MenuItem Header="Copy" Command="{x:Static IgCommands:XamGridCommands.CopySelectedRowsToClipboard}" CommandParameter="{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}"> <MenuItem.Icon> <Image Width="16" Source="/Resources/Images/Ribbon/Copy.png"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Copy All" Command="{x:Static IgCommands:XamGridCommands.CopyAllRowsToClipboard}" CommandParameter="{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}"> <MenuItem.Icon> <Image Width="16" Source="/Resources/Images/Ribbon/CopyAll.png"/> </MenuItem.Icon> </MenuItem> </ContextMenu> </ig:XamGrid.ContextMenu>
My previous posting was nicely formatted when I clicked `Post`. Now... no so much!
lol
not so much
;)
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!
<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" });
Hello,
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.
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"/>
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.