I need to change current cell's CellValuePresenter style to xamComboEditorStyle in code behind.
Like this:
XamComboEditor xamComboEditorStyle = new Style(typeof(XamComboEditor)); Setter itemsProviderSetter = new Setter(XamComboEditor.ItemsProviderProperty, SymbolsItemsProvider); xamComboEditorStyle.Setters.Add(itemsProviderSetter);
CellValuePresenter cvp = CellValuePresenter.FromCell(e.Cell); ((XamComboEditor)cvp.Editor).Style = xamComboEditorStyle;
I get " An exception of type 'System.InvalidOperationException' occurred in PresentationFramework.dll but was not handled in user code. Additional information: 'XamComboEditor' TargetType does not match type of element 'CellValuePresenter'." error
I there any other way to achieve this?
Thanks,
Priya
Hello Priya,
The reason you are getting this error is because you are trying to set a Style of type XamComboEditor to a property that accepts a Style of type CellValuePresenter.
To set a selected cell’s CellValuePresenter style to show a XamComboEditor, I recommend that you follow the steps that I recommended to you at the forum post here: http://ko.infragistics.com/community/forums/t/90928.aspx
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewDeveloper Support IInfragistics Inc.www.infragistics.com/support