Hi,
I am using xamComboEditor in my project.
I have a requirement to meet that says "items in the combo box could be selected and unselected using space key"
Need input for the same.
Thanks in advance !
Hello Ashutosh,
Thank you for your post. I have been looking into it and I created a sample project for you, where you can select items with Spacebar, but you are not able to unselect them. Basically I created a Style for ComboEditorItemControl and added an EventSetter for the Loaded event. In the handler I get the Rectangle that shows when you navigate the items and handled its IsVisibleChanged event. In the second handler I check if the value is true and if it is I get the ComboEditorItemControl. I also handled the XamComboEditor’s PreviewKeyDown event and in the handler I select the ComboEditorItemControl if the pressed key is Spacebar. You can feel free to modify the sample further, so it fulfils all your requirements. You can also log a product idea for this to be added as built-in functionality. You can do this here:
http://ideas.infragistics.com/
Hope this helps you.
Hi Stefan,
thanks for your reply , i have seen your sample project, Now i am able to select item with Spacebar but i am facing one issue on it when we need to select more than one items. Currently the drop down popup is closed every time when we select any single item with Spacebar and if user wants to choose more than one value than user needs to again reopen the drop-down popup. It should be close when user select all items which he want to select and than press enter key/Tab.
Please use these prop as well in your sample project
CheckBoxVisibility="Visible" AllowFiltering="False" IsEditable="False" AllowMultipleSelection="True"
Request you to please help me it is very critical.
Thanks in advance.
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
I am still struglling with one issue related to space bar. when we deselect a combobox item using spacebar, the focus moves to first item. Is it possible to keep focus on same deselected combobox item.
Thanks in advance!
Hello Ashustosh,
I can say that when you deselect an item the focus moves to the above selected item and if there isn't such item it moves to the XamComboEditor. Currently this is the default behavior and it is controlled in code and you are not able to change it.
hi,
i have written following code snippet for the selection & deselection of xamcombo editor with the space bar , and we are facing issue when we deselect any item with spacebar focus always move to the XamComboEditor . as you have commented in previous post it does not remain on the above item of selected item. Please help .
private void notationTypeComboBox_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Space && (sender as XamComboEditor).IsDropDownOpen) { XamComboEditor xamCombo = sender as XamComboEditor; xamCombo.Items.Where(a => a.IsFocused).ToList().ForEach(a => a.IsSelected ^= true); e.Handled = true; } }
Hello Ashitosh,
I am just checking if you require any assistance or clarification on the matter.