Hello,
I'm creating a RadGridView which has one level of child grids within. The child grid rows contain the same data as the parent grid rows. Using themes, I have successfully removed any borders/padding/header-rows from the child grids such that when expanded, it simply appears as if you're adding in more rows to the current gridview. All of this works fine. The last problem I am having is that I am finding it difficult to align the columns. Ideally, the column borders in the main grid would line up exactly with those in the child grid. By using the following code, I have succeeded in achieving this for a majority of cases:
The reason that I have the IF condition is essentially to determine if there is going to be a scrollbar or not, which takes up 20 pixels on the right hand side of the screen. The problem is that sometimes, for two child views of even the exact same size, one will have a scrollbar and the other will not. This makes my logic entirely undependable. Is there a way that I can determine if a scrollbar exists in a child gridview?
Also, an this would be a bonus :-) Even though I've removed the padding around my child grids, there still remains some padding, perhaps one-row in width, at the bottom of each that I would really like to get rid of. Any thoughts on this?
Thanks!
Jeremy
I'm creating a RadGridView which has one level of child grids within. The child grid rows contain the same data as the parent grid rows. Using themes, I have successfully removed any borders/padding/header-rows from the child grids such that when expanded, it simply appears as if you're adding in more rows to the current gridview. All of this works fine. The last problem I am having is that I am finding it difficult to align the columns. Ideally, the column borders in the main grid would line up exactly with those in the child grid. By using the following code, I have succeeded in achieving this for a majority of cases:
if (e.ChildViewInfo.Rows.Length < 6) |
{ |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Network].Width = grdRecord.Columns[(int)RecordScorpion.Column.Network].Width - 1; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Item].Width = grdRecord.Columns[(int)RecordScorpion.Column.Item].Width - 1; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Value].Width = grdRecord.Columns[(int)RecordScorpion.Column.Value].Width; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Date].Width = grdRecord.Columns[(int)RecordScorpion.Column.Date].Width; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Line].Width = grdRecord.Columns[(int)RecordScorpion.Column.Line].Width; |
} |
else |
{ |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Network].Width = grdRecord.Columns[(int)RecordScorpion.Column.Network].Width - 20; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Item].Width = grdRecord.Columns[(int)RecordScorpion.Column.Item].Width - 1; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Value].Width = grdRecord.Columns[(int)RecordScorpion.Column.Value].Width; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Date].Width = grdRecord.Columns[(int)RecordScorpion.Column.Date].Width; |
e.ChildViewInfo.ViewTemplate.Columns[(int)RecordScorpion.Column.Line].Width = grdRecord.Columns[(int)RecordScorpion.Column.Line].Width; |
} |
The reason that I have the IF condition is essentially to determine if there is going to be a scrollbar or not, which takes up 20 pixels on the right hand side of the screen. The problem is that sometimes, for two child views of even the exact same size, one will have a scrollbar and the other will not. This makes my logic entirely undependable. Is there a way that I can determine if a scrollbar exists in a child gridview?
Also, an this would be a bonus :-) Even though I've removed the padding around my child grids, there still remains some padding, perhaps one-row in width, at the bottom of each that I would really like to get rid of. Any thoughts on this?
Thanks!
Jeremy