简体   繁体   English

单选按钮检查的更改事件未在gridview中触发

[英]Radiobutton checked change event not firing in gridview

I have a gridview where i have a radio button. 我有一个gridview,我有一个单选按钮。 What i need is to on the selection of the radiobutton i have to find the datakey of the gridview. 我需要选择单选按钮时,我必须找到gridview的数据键。 Also one more issue with that is , i can select more than one radio button, which should not happen. 另外一个问题是,我可以选择多个单选按钮,这不应该发生。

You need to use a literal control to inject radio button markup. 您需要使用文字控件来注入单选按钮标记。 This will handle grouping so only one radio button is selected. 这将处理分组,因此仅选择了一个单选按钮。 You cannot do it with the standard radio control group. 您不能使用标准的无线电控制组来执行此操作。

See this for a complete example with working code: 请参阅此以获取具有工作代码的完整示例:

http://www.asp.net/data-access/tutorials/adding-a-gridview-column-of-radio-buttons-vb http://www.asp.net/data-access/tutorials/adding-a-gridview-column-of-radio-buttons-vb

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

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