GridViewColumn Width * (Star) in HierarchyChildTemplate

2 posts, 0 answers
  1. Bruno
    Bruno avatar
    54 posts
    Member since:
    Jul 2012

    Posted 31 Dec 2012 Link to this post


    If I have a GridView with a HierarchyChildTemplate of Type GridView and this GridView has a GridViewColumn with Width in * (Star), the Width of the GridView is too long.


    <telerik:RadGridView x:Name="TestGridView" AutoGenerateColumns="False">
                <telerik:GridViewDataColumn Header="LastName" DataMemberBinding="{Binding LastName}" Width="500"/>
                <telerik:GridViewDataColumn Header="FirstName" DataMemberBinding="{Binding FirstName}" Width="200"/>
                   <telerik:RadGridView ItemsSource="{Binding Addresses}" AutoGenerateColumns="False">
                         <telerik:GridViewDataColumn Header="Street" DataMemberBinding="{Binding Street}" Width="3*"/>
                         <telerik:GridViewDataColumn Header="PostCode" DataMemberBinding="{Binding PostCode}" Width="*"/>
                         <telerik:GridViewDataColumn Header="City" DataMemberBinding="{Binding City}" Width="2*"/>


    Now, the width of the inner GridView is too long. How could I make that the inner Grid has the same Width like the outer one? (without fix width)

    Thank you, kind regards


  2. Yoan
    Yoan avatar
    1215 posts

    Posted 02 Jan 2013 Link to this post

    Hello Bruno, 

    In order to achieve your goal, I can suggest you to bind the child GridView's Width to the one of its parent. Please take a look at this forum thread for a reference.

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top