在DataGridview中删除选择 [英] Remove Selection in the DataGridview
本文介绍了在DataGridview中删除选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我在应用程序中使用DataGridView.
我想在Load事件中删除选择.
除非用户单击某个单元格,否则加载时在Gridview中不应存在Selection.
我该如何执行.
谢谢
问候
Lakshman
Hello,
I am Using DataGridView in an Application.
I want to Remove Selection on the Load event.
There should not be Selection in the gridview when loading unless the user Clicks a cell.
How can I Perform this.
Thank you
Regards
Lakshman
推荐答案
嗨lakshman,
尝试一下如何:
在窗口的加载事件中,执行以下代码:
如果(datagridview1.SelectedCells.count> 0)
{
dataGridView1.SelectedCells [0] .Selected = False;
}
hi lakshman,
how about trying out this :
in the load event of the window do this write the code below :
if (datagridview1.SelectedCells.count>0 )
{
dataGridView1.SelectedCells[0].Selected=False;
}
这篇关于在DataGridview中删除选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文