我在datagrid的html里添加一个模板列,增加radiobuttonlist项。
代码:
<asp:TemplateColumn HeaderText=" 权限">
<ItemTemplate>
<asp:RadioButtonList ID="x" Runat="server" RepeatDirection="Horizontal" >
<asp:ListItem Value="3" Text="x1"></asp:ListItem>
<asp:ListItem Value="2" Text="x2"></asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateColumn>问题1:在客户端,给一个RadioButtonList的item选择值(x1或者x2)后,不能不选择了。我的意思是它应该像checkboxlist一样,点一次为“选择”,再点一次为“放弃”,即"都不选择"。请问怎么办?
问题2:要引发RadioButtonList的change事件,怎么引发?
代码:
<asp:TemplateColumn HeaderText=" 权限">
<ItemTemplate>
<asp:RadioButtonList ID="x" Runat="server" RepeatDirection="Horizontal" >
<asp:ListItem Value="3" Text="x1"></asp:ListItem>
<asp:ListItem Value="2" Text="x2"></asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateColumn>问题1:在客户端,给一个RadioButtonList的item选择值(x1或者x2)后,不能不选择了。我的意思是它应该像checkboxlist一样,点一次为“选择”,再点一次为“放弃”,即"都不选择"。请问怎么办?
问题2:要引发RadioButtonList的change事件,怎么引发?
解决方案 »
- 关于sql行转列的问题
- 大家来看看网页图像的问题啊!
- 关于动态生成控件 获取控件的值的问题,
- 自动打开最快镜像~~
- 一段看起来简单 却感到疑惑的代码 哪位大哥帮我看看
- 怎么把表中ID号绑到HyperLink控件?
- 如何把数据库中日期时间(2005-4-18 12:12:20)读出来的时候显示成2005-4-18
- 请问哪里有treeview的使用说明,最好是详细一点的。
- 我的工具箱中的web窗体怎么不见了!
- 如何在程序中动态DataGrid的TemplateColumn列。
- 请求解说一下创建asp.net WEB应用程序时自动产生的各文件的用途
- 如何把DataSet中的两个DataTable中的数据,同时显示在一个网格上
2。在在oncheckedchanged事件中取值
string city = ((RadioButtonList)e.Item.findcontrol("x")).SelectItem.Text;