取消dataGridView默认选中行的问题
想取消dataGridView的默认选中行
用show()方法单独打开A界面后用以下方法可以实现。
dataGridView_sp.ClearSelection();
dataGridView_sp.CurrentCell = null;
dataGridView_sp.TabStop = false;
但是想把A界嵌到B界面中,用以下语句打开,并对A界面的DataGridView取消默认选中行就无效。
A.TopLevel = false;
B.panel_main.Controls.Add(A);
A.Show();