7 Answers, 1 is accepted
0
Hi Alex,
I believe that casting the SelectedItems to IList and calling the Clear() method will help you.
All the best,
Ivo
the Telerik team
I believe that casting the SelectedItems to IList and calling the Clear() method will help you.
var list =
this
.AutoComplete.SelectedItems
as
IList;
if
(list !=
null
)
{
list.Clear();
}
All the best,
Ivo
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
Alex
Top achievements
Rank 1
answered on 09 Jan 2013, 06:46 AM
What about the visual representation of clearing the selections from the control? It's not happening. How to programmatically remove or add items to the control and have the control reflect the changes? Why can't it behave more like a ListBox in that aspect where you can do things like listBox1.SelectionItems.Add(item)?
RadAutoCompleteBox just doesn't feel like a completely functional control like it should.
RadAutoCompleteBox just doesn't feel like a completely functional control like it should.
0
Accepted
Hi Alex,
I tried this and it worked as expected. You can find my sample project attached. It would be great if you modify it to demonstrate the issue and send it back to us so we will be able to investigate it further. We will also consider changing the Selecteditems' interface from IEnumerable to IList.
Greetings,
Ivo
the Telerik team
I tried this and it worked as expected. You can find my sample project attached. It would be great if you modify it to demonstrate the issue and send it back to us so we will be able to investigate it further. We will also consider changing the Selecteditems' interface from IEnumerable to IList.
Greetings,
Ivo
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
Alex
Top achievements
Rank 1
answered on 12 Jan 2013, 03:30 AM
I found that I didn't have the latest RadControls. After upgrading to the latest, this issue went away. But yes, it would be better if one doesn't need to cast SelectedItems to IList in order to perform clear, add, remove item operations. Thanks for looking into this.
0
Sreelaskshmi
Top achievements
Rank 1
answered on 07 Sep 2017, 06:12 AM
HI Ivo,
In my case ,user want to select all selected items(4016,4011 please refer attachment) by pressing the ctrl+A & press delete to clear the items.
Please let me know ,How to implement this requirement.
Thanks,
Mohan G
0
Hello Sreelaskshmi,
We will check your scenario and contact you again as soon as we have more information about your case.
Thank you for your patience.
Regards,
Dinko
Progress Telerik
We will check your scenario and contact you again as soon as we have more information about your case.
Thank you for your patience.
Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Hello Sreelaskshmi,
Thank you for your patience.
RadAutoCompleteBox doesn't support selecting the selected items and clear them using the delete key. But you can achieve such behavior by subscribing to the PreviewKeyDown event and set the SelectedItems collection of the RadAutoCompleteBox to null.
I have created sample project which demonstrates one way which you can use to achieve such behavior. I have also added a visual notification of the items when you pressed CTRL+A key combination. I think this project is a good starting point for achieving your final behavior. You can additionally modify the project so it covers all your cases in your main application.
Regards,
Dinko
Progress Telerik
Thank you for your patience.
RadAutoCompleteBox doesn't support selecting the selected items and clear them using the delete key. But you can achieve such behavior by subscribing to the PreviewKeyDown event and set the SelectedItems collection of the RadAutoCompleteBox to null.
I have created sample project which demonstrates one way which you can use to achieve such behavior. I have also added a visual notification of the items when you pressed CTRL+A key combination. I think this project is a good starting point for achieving your final behavior. You can additionally modify the project so it covers all your cases in your main application.
Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.