Is it possible to remove default selection in DataGridView?
-
Hi, I have a DataGridView on form, I set MultiSelect = false. By default, the DataGridView always has top left cell selected, is it possible that the DataGridView has nothing be selected by default? Thanks!
-
Hi, I have a DataGridView on form, I set MultiSelect = false. By default, the DataGridView always has top left cell selected, is it possible that the DataGridView has nothing be selected by default? Thanks!
you can undo any selection by calling ClearSelection(). What I do for DGV-based viewers that never want anything selected is add a handler (C# code alert):
private void dgv_SelectionChanged(object sender, EventArgs e) {
dgv.ClearSelection();
}:)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
you can undo any selection by calling ClearSelection(). What I do for DGV-based viewers that never want anything selected is add a handler (C# code alert):
private void dgv_SelectionChanged(object sender, EventArgs e) {
dgv.ClearSelection();
}:)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
Luc, Working great, Thank you very much.