DockWindow size equal to child form with a GridView

2 posts, 0 answers
  1. George
    George avatar
    62 posts
    Member since:
    Sep 2008

    Posted 13 Apr 2015 Link to this post

    Hi,

    I am using raddock control to host dock windows that as a child have a form with a docked gridview, as per picure attached.

     

    My aim is to have the dockwindow width equal to the gridview hosted inside the form. I can achieve this the first time the dock window is created, but if the user changes the width of a column in the gridview I cannot figure out how to programmatically change the parent form's width to be equal to the gridview width, and subsequently the dockwindow width to be equal to the hosting the gridview form width.

    The second picture attached displays the desired effect, the form having the same width as the gridview, and also the dockwindow hosting the has a similar width.

    I would appreciate your input,

     

    Regards,

     

    George

  2. Dess
    Admin
    Dess avatar
    1605 posts

    Posted 16 Apr 2015 Link to this post

    Hello George,

    Thank you for writing.

    Following the provided information I have prepared a sample project where the RadDock is used an MDI container. In the child form there is a RadGridView bound to the Northwind.Categories table. In order the grid to fill the entire form's size, you should set the RadGridView.Dock property to DockStyle.Fill. Additionally, in order the columns to be spread over the whole grid, you can set the RadGridView.AutoSizeColumnsMode property to GridViewAutoSizeColumnsMode.Fill. Please refer to the attached gif file illustrating the behavior on my end. 

    If it does not suit your requirement, it would be greatly appreciated if you can provide additional information about the exact requirement that you are trying to achieve. Thank you.

    I hope this information helps. Should you have further questions, I would be glad to help.
     
    Regards,
    Dess
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top