Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
500
How to change Change CellValuePresenter's style to XamComboEditorStyle?
posted

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

  • 34810
    Offline posted

    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://es.infragistics.com/community/forums/t/90928.aspx

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Developer Support I
    Infragistics Inc.
    www.infragistics.com/support