Reputation: 31
There are a SplitContainer and couple of DataViewGrids. In Designer I docked DataViewGrids to Panel1 and Panel2 of SplitContainer respectively. So, in designer everithing seems to be OK. But when I start the program, the DataGridView seems like it's docked to the main form, because the size of the Grid is the main Form size. I use the Grids with bindings to DataSet. When I try to use not binded blanc Grids, everithing is ok. The grids size matches the splitContainer Panels sizes. That drives me insane:(
Upvotes: 1
Views: 3892
Reputation: 31
So I resolved, that problem. I put that code after all data bindings of dataGRidView
dataGridViewPO.Dock = DockStyle.Fill;
dataGridViewPO.Parent = splitContainer1.Panel1;
Upvotes: 2
Reputation: 4683
ok you should set dockstyle of grid to fill the panel as this
datagrid1.Dock=DockStyle.Fill;
Upvotes: 2