简体   繁体   English

即使MultiSelect属性设置为false,DataGridView也会显示选中的几个项目

[英]DataGridView shows several items selected even if MultiSelect property is set to false

I am using System.Windows.Forms.DataGridView and I have set MultiSelect = false and SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect , this doesn't allow user to select multiple items. 我正在使用System.Windows.Forms.DataGridView,并且设置了MultiSelect = falseSelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect ,这不允许用户选择多个项目。 While doing testing I found when we use the down arrow to change the selection - in normal speed it works fine, but when you perform it in a faster speed, it marks some other item as selected. 在进行测试时,我发现当我们使用向下箭头更改选择时-在正常速度下它可以正常工作,但是当您以更快的速度执行它时,它将其他项标记为选中状态。

Is there a way to resolve this issue? 有没有办法解决这个问题?

与其使用KeyDownEvent,不如使用KeyUpEvent。

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

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