在Datagridview中创建单选按钮 [英] Creating Radiobutton in Datagridview
本文介绍了在Datagridview中创建单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我需要创建一个包含三列的出勤表单,该列包括当前,半天,缺席,使用datagridview的人员名称.请帮助我在datagridview中添加单选按钮.
问候
Ananya
Hello
I need to create a attendance form having three columns present,half day,absent,name of person using datagridview.Please help me to add radio buttons to datagridview.
regards
Ananya
推荐答案
^ ]肯定会帮助您.
http://msdn.microsoft.com/en-us/library/aa730882%28v=vs.80%29.aspx[^] should surely help you out.
看看这个为DataGridView控件构建自定义单选按钮单元和列 [ ^ ].
稍微用手一点可能是合适的.
用户不需要知道他正在查看的3列实际上是一列.
您可以在标题模板中添加一些html,在单个列中创建3个笨拙的对象.
将所有单选按钮放在一栏中,使其看起来像3.
否则,您可以在每个单选按钮上捕获onchange事件,对检查进行编码以查看其他单选按钮(在该gridviewrow对象上)是否包含任何东西,然后将其移除.
我知道需要回发.
Hi,
A little slight of hand might be appropriate.
The user does not need to know that the 3 columns he is looking at is actually one.
You could add some html to the header template, creating 3 clumns in a single column.
Put all the radio buttons in the one column and make it look like 3.
otherwise, you could catch the onchange event on each radio button, code a check to see if the other radio buttons have anything in them (on that gridviewrow object) and remove if they do.
Requires a postback, i know.
这篇关于在Datagridview中创建单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文