Hi,
I want to add a context menu to my grid.
i used the following sample:
http://forums.infragistics.com/blogs/devin_rader/archive/2011/04/15/extending-xamgrid-with-a-right-click-context-menu.aspx
now i have 2 questions:
i implemented the IProvidePropertyPersistenceSettings but nothing change until i added the following.
i added the following
PropertyNamePersistenceInfo pnpi = new PropertyNamePersistenceInfo();
pnpi.PropertyName = "ContextMenuSettings";
p.IgnorePropertySettings.Add(pnpi);
ms = PersistenceManager.Save(xamSESGrid1,p);
but even without the implementation, it worked. can it be applied without the implementation?
thanks for you help
Thanks for the sample. It helped me identify the issue right away.
Basically, b/c you're exposing the the Grid property publicly the PersistenceManager tries to save it, and this essentially causes an infinite loop of persistence.
So, to tell the PersitenceManager not to save this property you simply need to implement the IProvidePropertyPersistenceSettings interface.
#region IProvidePropertyPersistenceSettings Members public List<string> PropertiesToIgnore { get { return new List<string>() { "Grid" }; } } public List<string> PriorityProperties { get { return null; } } public void FinishedLoadingPersistence() { } #endregion
-SteveZ
please find a sample that will load itemsSource, save layout then load layout the error will appear.
1 - it you remove the property "ContextMenuSettings" from the class xamSESGrid, the error will disappear
1. I'm not sure about the error you're getting. Do you have a StackTrace? Or even better could you share your sample?
2. A HeaderCell's Visual element isn't a CellControl, its a HeaderCellControl, so you should pass that in as the generic argument instead.