Similar to the question posted here a long time back, http://es.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
Hi Sue,
I think Krasimir has the solution for you and he has samples with his forum post. http://es.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.
Hi Marianne,
Thanks for your quick response. The link you provided was helpful.
However I need something that is a combination of both the Datatrigger and StyleSelector. Like I Mentioned in my post earlier.. the Datagrid is a set of dynamicColumns(MVVM style) and each cell is of different style (buttons/comboboxes,textboxes etc..) I need the datatrigger for when in my menu option the user selects a option which triggers a stylechange... with the given sample I am not fully clear on how I can achieve this..
thanks,
I was able to find a solution. I used a combination of what you have suggested and the following link "http://es.infragistics.com/community/forums/p/60097/305176.aspx"
These helped me achieve what I was aiming for.. :)
Thanks again for your support.
That's an excellent post on the topic. Glad you found that and posted the link. It's very likely to help others.
Let me know if there is anything more I can help you with.