datagridview中的复选框实现 [英] Checkbox implementation in datagridview

查看:333
本文介绍了datagridview中的复选框实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我遇到这样的情况,第一列具有复选框并具有多行.我需要实现切换功能,以便用户只能从多行中选择一个复选框.基于选择,我需要更新特定的网格行并将其更新到数据库中.请帮忙.

谢谢
Rohit

Hello ALL,

I have situation where first column have checkbox and have multiple rows.I need to implement toggle functionality so that user will select only one checkbox out of multiple row.Also based on selection i need to update particular row of grid and update it into database.Please help.

Thanks
Rohit

推荐答案

使用datagrid的cellvaluechanged事件

如果e.colindex(值的列已更改)=(您的复选框列)
然后-)>在数据网格的所有行中运行并根据需要进行更新
use the cellvaluechanged event of the datagrid

if the e.colindex (the column of the value changed) = (your checkbox column)
then -)> run through all rows of the datagrid and update as you need


这篇关于datagridview中的复选框实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆