DataGridView without selected row at the beginning

后端 未结 12 1034
栀梦
栀梦 2021-02-12 14:23

In my WinForms I have DataGridView. I wanted to select full row at once so I set SelectionMode as FullRowSelect. And now I have problem, b

12条回答
  •  余生分开走
    2021-02-12 14:41

    The event to set for disabled selected row at start is this, and manage a FLAG to stop the ClearSelection

    private void dataGridView_SelectionChanged(object sender, EventArgs e)
    {
    
        if (FLAG==true)
        {
           dataGridView.ClearSelection();
           FLAG=false;
        }
    }
    

提交回复
热议问题