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
295
How do I trigger a EditorStyleSelector
posted

Similar to the question posted here a long time back, http://www.infragistics.com/community/forums/t/31040.aspx How can I trigger the editorStyleSelector to be fired.

I have a project - MVVM with Dynamic Columns. I need to be able to switch Editor Styles based on when a user clicks on a Checkbox ( like a Template Swap - maybe). The cells are either TextBoxes, ComboBoxes etc . Now I nee to have the ability for the display to change to something else like TextBoxes may become comboxes, ComboBoxes may get greyed out etc..  Currently, I have a StyleSelector Converter that defines the Style for each of the  cells (based on conditions in the ViewModel)..

I noticed that the StyleSelector does not accept triggers (like DataTriggers in WPF) for me to achieve this.. Can you kindly suggest how I can achieve this??

Look forward to hearing from you.

Thanks,

Sue

Parents
  • 12875
    Verified Answer
    posted

    Hi Sue, 

    I think Krasimir has the solution for you and he has samples with his forum post.   http://www.infragistics.com/community/forums/p/80726/407822.aspx 

    First you would create CellValuePresenter styles for the editor controls you may need and a class that derives from StyleSelector so that you can determine which style you are going to use.  Then you would set the CellValuePresenterStyleSelector to an instance of your new class. 

    His other sugestion is to use triggers in a CellValuePresenter style that set the Template property of the CellValuePresenter. 

    Please let me know if you have any questions.

Reply Children