我有三种形式:的DataGridView刷新窗口C#桌面应用程序
- Form1中(这是MDI)
- 窗体2(MDI的孩子)
- Form3(窗体2的小孩)
在我的应用程序Form1(MDI)首先打开,其中子窗体(Form2)已打开菜单,现在Form2有linkButton,当我单击另一个窗体(Form3)时已打开。 Form3具有Form3的formLoad上的DataGridView1。
我想要的DataGridView1绑定后,其第二行应该作为选定。 对于我写这段代码:
DataGridView1.Rows[1].Selected = true; // 1 is the index of that row.
但是这个代码不工作,问题是,DataGridView的是没有得到刷新。
u能提供相关的代码? – Coder 2012-03-28 10:32:49
@ coder抱歉,实际上它对我来说很难在这里放置一个代码,这是令人困惑的。只有我想要的东西,即我的DataGridView1不刷新,即使使用DataGridView1.Refresh()Function.Or后,您可以说我的DataGridView1在将Selected属性设置为true后不再重新绘制。 – 2012-03-28 10:42:49