Setting the size of a docked toolwindow?

12 posts, 1 answers
  1. Malcolm
    Malcolm avatar
    13 posts
    Member since:
    Oct 2007

    Posted 31 Jan 2011 Link to this post

    Can set the default size for auto hide, but can't seem to set the size for when the window is docked. Would rather set a minimum size on it to make it usable.

    Is there a way to do this?
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 02 Feb 2011 Link to this post

    Hello Stephen,

    you can set the size of your docked ToolWindow in the following way

    Dim window As ToolWindow = Me.ToolWindow1
    Dim strip As DockTabStrip = DirectCast(window.TabStrip, DockTabStrip)
    strip.SizeInfo.AbsoluteSize = New System.Drawing.Size(100, strip.SizeInfo.AbsoluteSize.Height)

    Hope that helps
    Richard
  3. Malcolm
    Malcolm avatar
    13 posts
    Member since:
    Oct 2007

    Posted 02 Feb 2011 Link to this post

    Thanks Richard. Set me on the right path:

    Dim navwin As HostWindow = Me.RadDock1.DockControl(Navigator, Telerik.WinControls.UI.Docking.DockPosition.Left, Telerik.WinControls.UI.Docking.DockType.ToolWindow)
    Dim strip As DockTabStrip = DirectCast(navwin.TabStrip, DockTabStrip)
    strip.SizeInfo.AbsoluteSize = New System.Drawing.Size(300, strip.SizeInfo.AbsoluteSize.Height)

    Works perfect!
  4. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 02 Feb 2011 Link to this post

    Glad I could help. Please remember to mark as answer.
    Thanks
    Richard
  5. Raji
    Raji avatar
    4 posts
    Member since:
    Mar 2015

    Posted 04 Jan 2018 Link to this post

    I create a new tab, to a raddock, but when I try and switch back to another tab, I get

     

    System.NullReferenceException: Object reference not set to an instance of an object.
       at Telerik.WinControls.UI.Docking.DockTabStrip.ProcessFocusRequested(RadElement element)

     

    How do i fix this?

     

    Thanks.

  6. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 04 Jan 2018 Link to this post

    Hello, Raji, 

    Thank you for writing.  

    The provided information is not enough for me to replicate the problem locally. Could you please specify the exact steps how to reproduce the problem? Alternatively, you can submit a  support ticket with a complete description of the precise case and provide a sample project demonstrating the exception. Thus, we would be able to make an adequate analysis of your scenario and assist you further. Thank you in advance.

    I am looking forward to your reply. 

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. Raji
    Raji avatar
    4 posts
    Member since:
    Mar 2015

    Posted 04 Jan 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    I have a document container with 3 tabs on it as the attached snap show.  Each of them works fine right now, and I can switch between them.

    I needed to add another one. From the radDock tab I clicked and did, "Add Tabbed Document". This works fine.

     

    Whens I run the code though, when I try and click on the other tabs it crashes, and the I get the above stack trace.

     

  8. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 05 Jan 2018 Link to this post

    Hello, Raji, 

    Thank you for writing back. 

    Following the provided information, I tried to replicate the error but without any success. Please refer to the attached gif file illustrating the behavior on my end. Am I missing something? I have also attached my sample project. Is it possible to provide a video demonstrating what steps do I need to perform in order to obtain the unexpected behavior? Thank you in advance for your cooperation.

    I am looking forward to your reply.

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  9. Raji
    Raji avatar
    4 posts
    Member since:
    Mar 2015

    Posted 05 Jan 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    that it was I was doing, but its still crashing, so I redesigned the form from scratch for now at that worked.
  10. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 08 Jan 2018 Link to this post

    Hello, Raji, 

    Thank you for writing back. 

    I am glad that after redesigning the problem you were facing has gone.

    If you have any additional questions, please let me know. 

     Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  11. Gh Reza
    Gh Reza avatar
    12 posts
    Member since:
    Jul 2011

    Posted 21 Apr Link to this post

    Hi dear admin !

    Can i fix radDock toolwindow size ?

    I want  restrict toolwindow minimum or maximum size on runtime by user.

  12. Nadya
    Admin
    Nadya avatar
    398 posts

    Posted 24 Apr Link to this post

    Hello Gh Reza,

    Thank you for writing.

    In order to restrict the size of a toolwindow, you can use the MinimumSize and MaximumSize properties. Here is an example that demonstrates how you can fix the tool windows height:

     public RadForm1()
            {
                InitializeComponent();
    
                ToolWindow window1 = new ToolWindow();
                ToolWindow window2 = new ToolWindow();
                ToolWindow window3 = new ToolWindow();
    
                this.radDock1.DockWindow(window1, DockPosition.Top);
                this.radDock1.DockWindow(window2, DockPosition.Top);
                this.radDock1.DockWindow(window3, DockPosition.Top);
    
                window1.TabStrip.SizeInfo.MinimumSize = new System.Drawing.Size(0, 100);
                window2.TabStrip.SizeInfo.MinimumSize = new System.Drawing.Size(0, 100);
                window3.TabStrip.SizeInfo.MinimumSize = new System.Drawing.Size(0, 100);
    
    
                window1.TabStrip.SizeInfo.MaximumSize = new System.Drawing.Size(0, 300);
                window2.TabStrip.SizeInfo.MaximumSize = new System.Drawing.Size(0, 300);
                window3.TabStrip.SizeInfo.MaximumSize = new System.Drawing.Size(0, 300);
            }

    Additional information about RadDoc is available in the following help article: https://docs.telerik.com/devtools/winforms/controls/dock/object-model/example-building-an-advanced-layout-at-runtime

    I hope this helps. Should you have other questions do not hesitate to ask.

    Regards,
    Nadya
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top