This is a migrated thread and some comments may be shown as answers.

Hierarchy Child Grid Star Sizing

3 Answers 40 Views
GridView
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 28 Nov 2009, 07:27 AM

Hello,

In Q3 hierarchy child grids are sized to take up the entire width available, where as in Q2 they only took up as much space as they required and no more.
(see demo: http://demos.telerik.com/silverlight/#GridView/Hierarchy/CustomHierarchy)

I'm struggling to find a way to replicate this behaviour in Q3, it appears the header control (GridViewHeaderRow) inside the GridViewDataControl template is causing this quirk - if I comment this out (so the headers are not displayed) then the grid behaves correctly and only takes up as much space as it requires. It's as though the header control is adding an "extra" column on the end of my hierarchy child grids and setting the width to star so it stretches right out, without me telling it to.

Help appreciated!

James.

3 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 03 Dec 2009, 08:20 AM
Hello James,

You can use the HierarchyChildTemplate property to define any property on the child grids. Take a look at this online example for a sample usage. For example you can set the ColumnWidth property of the child grid to * (ColumnWidth="*"). This way the child columns will automatically fill the whole available space.

Hope this helps,
Stefan Dobrev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
James
Top achievements
Rank 1
answered on 04 Dec 2009, 09:53 PM
Hi Stefan,

Thanks for the tip on star sizing.

I would like my HierarchyChildTemplate to auto size, which does not work in Q3 when the parent is star sized.

If both the parent and child are auto sized then this works fine, but I'm trying to achieve Q2 functionality where it would allow me to have a parent star sized and its children auto sized.

Does that make sense?

Regards,
James.
0
Stefan Dobrev
Telerik team
answered on 10 Dec 2009, 10:20 AM
Hi James,

Actually this scenario you are describing the child grid is sized with Auto, but as of Q3 we create an empty element to fill up the available space in order to correctly implement the horizontal virtualization. For example if you look at Microsoft's DataGrid you will also see this "empty column" that fill up the empty space if the grid is wider that its columns width.

Sincerely yours,
Stefan Dobrev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
James
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
James
Top achievements
Rank 1
Share this question
or