Hi,
I am working on XAM combo editor and I have bind location with Combo editor. But we want that we can select multiple location at one time. and selected all location how we can get in ViewModel. Because Right now we have set Allow Multiple Selection property so, we are able to select multiple data items, but we are not able to get all selected data in View Model. I have set Multiple selected Items property but as i add then multiple selection does not work.
<ig:XamComboEditor IsEditable="True" Name="LocationComboBox" Grid.Row="1" Grid.Column="2" EmptyText="Select ..." ItemsSource="{Binding Path=Locationdata}" SelectedValuePath="Location_Id" DisplayMemberPath="Location_Name" SelectedItem="{Binding SelectedLocation}" AllowMultipleSelection="True" IsSelectedMemberPath="Location_Name" />
Please any help would be a appreciate.
Hello Pri,
I am just checking if there is anything else I can do for you.
Thank you for your post.
I have been looking into the functionality that you are looking for and I created short sample application, based on your scenario to show you how you can implement it. Basically in the attached sample application I handled KeyDown and SelectionChanged events of XamComboEditor. I used a bool variable to determine whether the Shift Key was pressed or not. In the handler of SelectionChanged event I check whether adding or deleting items from the collection. If adding item I check while Shift key was pressed. If it is pressed I get the index of first selected item and the index of last one. Then I loops into the collection between first and last index and set IsSelected property to True for each item.
Please let me know if you need any further assistance on the matter.
Thanks for your quick reply. But we don't want to select all Items while using Shift Key. Suppose We have 10 Items and if we checked Fourth Number of item and while pressing Shift Key If we select Eight Number of Item At that point, Number between Four to Eight should be select.Any help for that??
Thanks
Thank you for your feedback, I am glad that my suggestion was helpful for you.
I have been looking into the requirement that you try to achieve and what I can suggest is to take a look at the following forum thread, where the similar functionality was achieved:
http://es.infragistics.com/community/forums/t/64661.aspx
Also if you just want to select all items in XamComboEditor when press the shift key, you can handle the KeyDown event and check in its handler, about the key that was pressed. If it is equal to LeftShift key, you can loops into the ComboEditorItems and change its IsSelected property to true. Please let me know if I am missing something about your scenario.
If you require any further assistance, please do not hesitate to ask.
Thanks.. for your support. and now I am on track and one thing more that,while holding Shift key all data should be select with in this drop down(using check box). Because now its not working with Shift key. Is there any additional code we have to add there???????. Please let me suggest for that.