G
Guest
I have seen this question asked elsewhere, but have never found an answer.
I'm adding a form to my app that has two datagrids - master and detail. The
dataset consists of two tables and a relation between them - parent and child
tables. One datagrid is bound to the parent table and the other to the
relation as follows:
this.grid1.DataSource = this.dataset;
this.grid1.DataMember = "Parent";
this.grid2.DataSource = this.dataset;
this.grid2.DataMember = "Parent.Relation";
This works correctly, except when setting the RowHeaderWidth of grid1 in the
designer to be 20, it resets back to 30. I even tried setting it the form
constructor but it doesn't have any effect. It appears that this is because
the grid is bound to a table that is the parent table of a relation and it
may need to display links to the relation and child table. But I have set
ParentRowsLabelStyle to None and ParentRowsVisible to false, but it still
doesn't set to anything under 30. On the second grid there is no problem
setting RowHeaderWidth to 20.
Any ideas how I can get around this. All the other grids in the app have
RowHeaderWidth of 20 and I want to keep the same style on this grid.
Thanks,
Scott
I'm adding a form to my app that has two datagrids - master and detail. The
dataset consists of two tables and a relation between them - parent and child
tables. One datagrid is bound to the parent table and the other to the
relation as follows:
this.grid1.DataSource = this.dataset;
this.grid1.DataMember = "Parent";
this.grid2.DataSource = this.dataset;
this.grid2.DataMember = "Parent.Relation";
This works correctly, except when setting the RowHeaderWidth of grid1 in the
designer to be 20, it resets back to 30. I even tried setting it the form
constructor but it doesn't have any effect. It appears that this is because
the grid is bound to a table that is the parent table of a relation and it
may need to display links to the relation and child table. But I have set
ParentRowsLabelStyle to None and ParentRowsVisible to false, but it still
doesn't set to anything under 30. On the second grid there is no problem
setting RowHeaderWidth to 20.
Any ideas how I can get around this. All the other grids in the app have
RowHeaderWidth of 20 and I want to keep the same style on this grid.
Thanks,
Scott