如何在C#中的datagridview中只选择一行 [英] How to select just one line in datagridview in C#

查看:872
本文介绍了如何在C#中的datagridview中只选择一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello ,
I want the user just select a line in the datagridview how to do it is urgent and thanks in advance





我尝试了什么:





What I have tried:

I gave the multiselectchanged method the value false and it does not work

推荐答案

这可能只是视觉呈现行选择方式的问题。它看起来像是在一行中选择了一个单元格。



将DataGridView的 SelectionMode 更改为当用户点击它时,FullRowSelect和整行将突出显示
This is probably just a problem with the way the row selection is presented visually. It will look like a single cell has been selected on a row.

Change the SelectionMode of the DataGridView to "FullRowSelect" and the entire row will be highlighted when the user clicks in it


这篇关于如何在C#中的datagridview中只选择一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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