This is a migrated thread and some comments may be shown as answers.
Automatically fit columns of child grid
5 Answers 86 Views
This is a migrated thread and some comments may be shown as answers.
papadi
Top achievements
Rank 1
papadi asked on 27 Aug 2012, 09:04 AM
Hi,
I have a Grid nested inside another one using RadGridView.ChildTableDefinitions. I cannot make the nested grid to fit it's columns to the width of the parent so that I don't have scroll bars (please see screenshot). I tried setting ColumnWidth to "Auto" for both grids but this didn't help.

5 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 30 Aug 2012, 05:59 AM
Hi Dimitrios,

In order to get the desired behavior, you can set ColumnWidth="*" instead of ColumnWidth="auto". For your convinience I have made sample project that you can find attached here.

Kind regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
papadi
Top achievements
Rank 1
answered on 30 Aug 2012, 07:55 AM
Hi,
I'm afraid this is not what I mean. Please take a look at the attachment. I need the column that ends at the red arrow to be expanded until the end of the grid, that is until the yellow arrow.
In my code I have an explicitely defined grid as datatable for the child grid, where I also set the ColumnWidth="*" but this didn't do it.
0
Accepted
Yoan
Telerik team
answered on 30 Aug 2012, 01:24 PM
Hi Dimitrios,

Please, excuse me for this inconvenience. In order to achieve your goal you should bind Grid's Width property to the one of the parent grid. However, in this case you need to expose a new class handling this specific binding. I am sending you a modified project illustrating the suggested approach.


Kind regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
papadi
Top achievements
Rank 1
answered on 31 Aug 2012, 08:46 AM
That did it! Thanks.
It changed the structured of my grid a bit though. Previously I was using hierarchy and I could expand all using grid.ExpandAllHierarchyItems. What's the equivalent for expanding Row Details? 
0
Yoan
Telerik team
answered on 03 Sep 2012, 02:49 PM
Hi Dimitrios,

 Other way to expand the row details is to use RowDetailsVisibilityMode property. Please check this forum post for more information.

All the best,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Asked by
papadi
Top achievements
Rank 1
Answers by
Yoan
Telerik team
papadi
Top achievements
Rank 1
Share this question
or