Hi,
I have a XamComboEditor with checkbox with each item. I want a checkbox with SelectAll option, which selects all the checkbox's at one go, and fires a Command on the ViewModel.
Is there any such implementation within XamComboEditor?
Thanks,
VJ
Hello VJ,
I have been looking into your post and I can suggest you change the default template of the XamComboEditor with adding a “Select all ” checkbox in the dropdown popup. You can find our default templates on your computer in the file C:\Program Files (x86)\Infragistics\NetAdvantage 2011.2\WPF\DefaultStyles\XamComboEditor\generic.xaml .
Furthermore you can used Checked/Unchecked events of the new Checkbox in order to select and unselect all items. For further reference please have a look at the attached sample that I created for you in order to demonstrate this possible approach.
If you need any further assistance on this matter, please do not hesitate to ask.
I saw your post. I think the approarch you gave is a in particular approach and I want a generalized solution to this problem.
I want to use the same functionality at 10 places where I have used this ComboBox, so, according to your implementation, I have to define the style at 10 places, which is not the I want to implement it. I want the style of each comboBox to remain same and handled from a single place.
In MVVM, we dont use events, we use Commands. So, I cant play directly on the Control. I have to use some kind of binding to have this implemented.
The checkbox attached to this comboBox doesn't fire any command on ViewModel, so, no use of this checkbox. I have to template it and use my own checkbox.
I hope, I have made the situation more clear to you.
Hi Elena, I tried your sample CheckBoxCombo (2).zip, which works for me, But no problem is, How do I uncheck the 'Select All' checkbox if one of the checkboxes gets uncheck.Hope to get help from you soon. If you have any questions please let me know. Thanks,Khush
I was just wondering did you have a chance to try my sample. If you still need any assistance on the matter, please do not hesitate to ask.
Here is the modified sample application where I used the approach described in my previous post. I move the default styles to the App.xaml file and bound the Command property of the “Select all” checkbox to a command from may view model and I provide a parameter for it that holds a reference to the XamComboEditor and current value of the “Select all ” checkbox.
If you need any additional clarifications on this matter. Please do not hesitate to contact me.
thanks for the reply.
Can you give me a sample project having this implementation?
I can see your concerns and I believe that your best option in case of multiple xamComboEditors is to move the style I created for you inside the App.xaml file instead of the resource section of the window and instead of handling Checked/Unchecked events you can bind the CheckBox’s Command property. Furthermore it may be suitable in your case to add as CommandParameter reference to the XamComboEditor itself, so you can iterate through the elements of the concrete editor and change their selection.
If you have any further questions on this matter, please do not hesitate to ask.