.net winforms 中有Radio grop 按钮吗?
有一个名为checkedListBox1的选项用于复选框组项目。
就像单选按钮的任何控件一样。以及如何在其中绑定我的数据(数据集)。
There is option called checkedListBox1 for check box group item..
Like that any control for radio button. and how to bind my data(data set) in that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
用户容器具有与组名称相同的功能。
容器可以是组框或面板
User container to have same functionality as like group name.
container can be group box or Panel
单选按钮没有这样的东西。不过,您可以寻找第三方控件或扩展现有的
CheckedListBox
,以便一次只能检查一项。第二种解决方案有点难看,因为看到复选框,用户会希望能够选择多个选项。
There is no such thing for radio buttons. You may, however, look for third party controls or extend the existing
CheckedListBox
so that only one item at a time can be checked.The second solution is a bit ugly, because seeing check boxes the user would expect to be allowed to select more than one option.
将单选按钮放在自己的面板中,它们将一起工作,面板中只有一个按钮可选。
至于数据绑定,有多种方法可用,例如为每个选项创建表单布尔属性,并将每个单选按钮绑定到其属性。
更简单的方法是使用 Jay Andrew Allen 的 RadioPanel< /a>,它负责将单选按钮选项绑定到枚举字段。
Put the radio buttons in their own panel, and they will work together, with only one button in the panel being selectable.
As for data-binding, there are several approaches available, such as creating a form Boolean property for each option, and binding each radio button to its property.
An easier approach would be to use Jay Andrew Allen's RadioPanel, which takes care of binding the radio button options to an enumeration field.