我有一个程序,当成员(member)资格即将到期时,该程序会从数据库中列出成员(member)。我想知道是否可以为每个成员生成并分组三个单选按钮,如下例所示:
成员(member) 1 o 续订 o 完成 o 结转
成员(member) 2 o 续订 o 完成 o 结转
成员(member) 3 o 续订 o 完成 o 结转
成员(member) 4 o 续订 o 完成 o 结转
然后,我将有一个提交按钮,该按钮将更新每个成员的数据,了解为他们选择的单选按钮。
谢谢
最佳答案
ASP.NET
如果您使用的是 ASP.NET 应用程序,则只需适当设置 GroupName
即可。请注意此声明from the MSDN documentation :
The buttons are grouped logically if they all share the same GroupName property.
Windows 窗体
如果您使用的是 Windows 窗体应用程序,则只需将每个 RadioButton
控件分组放入其自己的 GroupBox
或 Panel
中,它们就会被视为单独的分组。请注意此声明from the MSDN documentation :
All RadioButton controls in a given container, such as a Form, constitute a group. To create multiple groups on one form, place each group in its own container, such as a GroupBox or Panel control.
关于来自数据库的 C# 动态单选按钮组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15935075/