Automatically fit columns of child grid

6 posts, 1 answers
  1. papadi
    papadi avatar
    35 posts
    Member since:
    Nov 2008

    Posted 27 Aug 2012 Link to this post

    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.
  2. Yoan
    Admin
    Yoan avatar
    1068 posts

    Posted 30 Aug 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. papadi
    papadi avatar
    35 posts
    Member since:
    Nov 2008

    Posted 30 Aug 2012 Link to this post

    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.
  5. Answer
    Yoan
    Admin
    Yoan avatar
    1068 posts

    Posted 30 Aug 2012 Link to this post

    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.

  6. papadi
    papadi avatar
    35 posts
    Member since:
    Nov 2008

    Posted 31 Aug 2012 Link to this post

    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? 
  7. Yoan
    Admin
    Yoan avatar
    1068 posts

    Posted 03 Sep 2012 Link to this post

    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.

Back to Top
UI for WPF is Visual Studio 2017 Ready