简体   繁体   English

C# telerik winforms radDropDownList 多选

[英]C# telerik winforms radDropDownList multiselect

I have enabled multiple selections in the radDropDownList with below code.我使用以下代码在 radDropDownList 中启用了多项选择。

radDropDownList1.DropDownListElement.SelectionMode = SelectionMode.MultiExtended;

This list has 10 options and each user can choose one to 10 of them Now I want to retrieve the user selection that I saved in an array list ArrayList UserChoose = new ArrayList();这个列表有 10 个选项,每个用户可以选择其中的 1 到 10 个 现在我想检索我保存在数组列表中的用户选择ArrayList UserChoose = new ArrayList();

UserChoose = getUserChoose("username");

How can I through the code,Return user selections to the radDropDownList?如何通过代码将用户选择返回到 radDropDownList?

radDropDownList.Select = UserChoose ?

There is 2 ways how you can achive that.有两种方法可以实现这一目标。 It will be little complex but it will work for you I believe.它会有点复杂,但我相信它会为你工作。
Way 1:方式一:
As I think, you might not able to do that using only radDropDownList .我认为,您可能无法仅使用radDropDownList来做到这一点。 If still you want to do that using radDropDownList then you have to customized radDropDownList like in the telerik dicussion forum .如果您仍然想使用radDropDownList执行此操作,那么您必须像在telerik 讨论论坛中那样自定义radDropDownList Source code link is here .源代码链接在这里

在此处输入图像描述
Way 2:方式二:
You can use RadMultiColumnComboBox .您可以使用RadMultiColumnComboBox It will be easy to implement.这将很容易实现。 At the same time it has more features.同时它还有更多的功能。 Check link of telerik over here=> RadMultiColumnComboBox Documentation .在此处检查 telerik 的链接=> RadMultiColumnComboBox 文档

在此处输入图像 de## 标题 ##scription

Note: Personally I support the latter one rather than the former one.So, way 2 is much more effective.注意:我个人支持后者而不是前者。所以,方式2更有效。

The easiest replacement for a Windows Forms dropdown with multiple selection using Telerik is the RadCheckedDropDownList control, that is intended to provide that particular functionality. Windows Forms 下拉列表最简单的替代品是使用Telerik进行多项选择,该控件旨在提供该特定功能。

It is available since version 2018.1.116.它从 2018.1.116 版本开始可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM