Hi,
I have an ig:xamcomboeditor on the screen with a list of documents(these documents can have different revisions). The combo editor allows multiple selections and has check boxes property enabled. It also has an option added dynamically for Select All. When I check the box against Select All, the system needs to find a list of latest revision documents in combo editor and check the boxes against it and update the selected items for the combo editor.This has to be done dynamically. The user can also uncheck any document if he decidedes not to use it. At that moment, the select All should be unchecked as well. Any ideas on how this can be implemented. I tried to get it working by using the combobox1_SelectionChanged. But it doesnt ticks the check boxes if select all is checked. And if I try to select "Select All" again, it gives me an error.
Hello,
Thank you for your post.
Please correct me if my following impression is incorrect, but currently I am under the impression that you have a XamComboEditor with multiple selection and inside it, you have an item that acts as a "Select All" type of item. When clicking this item, you want all of the items in the XamComboEditor to become selected, and if you decide to deselect one of those items, you want the "Select All" item to become unselected. Have I understood your requirement correctly?
If so, I have gone off of the above impression and have created a sample project with this functionality. In the project, I handle the SelectionChanged event of the XamComboEditor and begin by checking the e.AddedItems collection of the event arguments. If the added item is the "Select All" item, then all of the items in the XamComboEditor get selected. The next check is for the e.RemovedItems collection of the event arguments. If the item that was deselected was not the "Select All" item, then I make sure to obtain the "Select All" item if it is selected and deselect it. These items are all obtained from the XamComboEditor's Items collection, and as of yet, I have been unable to see any types of errors occurring when clicking the Select All checkbox. Would it be possible for you to please provide some more detail on this error that you are seeing?
I have attached a sample project to demonstrate the above.
I hope this helps you. Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thanks for the reply. This helped me a lot. But got a few extra things. For e.g as I mentioned earlier about the revisions of the documents. Now suppose there is an extra property in the SampleData say age. When I select the 'Select All' option I would like to select only those Persons with age above say 30.
if (((SampleData)e.AddedItems[0]).Label.Contains("Select All")){ foreach (var item in combo.Items) { if ((((SampleData)item).age) >= 30) //But getting an error item.IsSelected = true; else item.IsSelected = false; }}I get an error saying I cannot convert Combobox.item to SampleData.
Thank You
BS