包含复选框列的Datagridview

编程入门 行业动态 更新时间:2024-10-27 21:19:34
本文介绍了包含复选框列的Datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好, 我在ASP.NET项目中使用datagridview,它有5个列,其中一个列的行号从1到10,其他列的复选框.如果用户从任何列中选择一个复选框,然后更改其想法并选择新的而不取消之前的选择之前保存按钮;首先选择的内容必须为空,否则消息将警告用户,提示已经选择了一个". 我该怎么办? 预先感谢

Hello, I''m using a datagridview in my ASP.NET project.It has 5 colums which one of them has line number from 1 to 10 and others have checkboxes.If A user selects a checkbox from any column and later changes his idea and select new one without unchecking previous selection before pressing save button ; first selection must be empty or a message warns user which says " there is already selected one ". How will I do this ? Thanks in advance

推荐答案

您可以使用网格单元验证事件来检查已选中复选框". You can use grid cell validating event to check that ''already a checkbox is selected''.

如果您只希望用户选择单行,则使用单选按钮更好. Using radio button is better if you just want user to select single row.

本文将为您提供帮助 高级编码-文章 谢谢 Hiren Soanki this article will definately help you HighonCoding - Article THanks Hiren Soanki

更多推荐

包含复选框列的Datagridview

本文发布于:2023-11-07 08:59:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566042.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:复选框   Datagridview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!