Maximum width

10 posts, 0 answers
  1. Daniel Plomp
    Daniel Plomp avatar
    130 posts
    Member since:
    Feb 2004

    Posted 16 Nov 2007 Link to this post

    Hi all,

    Maybe a simple question, but how can I define the maximum width of a dockpanel? So that if the window resizes, the width of the dockpanel stays fixed?

    Thanks,
    Daniel

  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 16 Nov 2007 Link to this post

    Hi Daniel,

    Thank you for the feedback.

    In our current release the docking component does not support this feature. We are planning to extend the docking layout features after our the Q3 release. Currently you may use the MinSize property of the DockPanel or the FixedSplitters of the DockingManager.

    If you have any additional questions, please contact us.


    Regards,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 16 Jan 2008 Link to this post

    Hi,

    I guess we have the same problem.

    We want a simple layout where the user has a panel (with navi tree or so) on the left and a working pane on the rest of the screen.

    What happens:
    We enlarge the whole window - the left pane changes width. (Only the rigth should).

    This "unwanted" but not so bad.
    But there is an other problem.

    When you make the window smaller the width of the left panel decreases.

    We tried to overcome this with "MinSize" -- and (from a first look) it seems to work.
    When the user tries to make the panel smaler this stops at "MinSize".

    But now the thing we guess it is a bug: (steps to reproduce)
    Make your window large.
    Make the panel as small as allowed in "MinSize".
    Now make the Window smaller -- the panel becomes smaller also.
    --Means MinSize does not work on window resizeing.

    Any Idea to overcome this?
    Or to habe the "fixed sized" panel on the left.

    "Next release" or so is not helpfull for us - our customers await a product;
    and as you will know (I guess) they await solutions ASAP :)

    Regards

    Manfred
  5. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 17 Jan 2008 Link to this post

    Hi Manfred,

    Thank you for getting back to us.

    For the time being, please use the workaround described in the code snippet below:

    public Form5()  
    {  
        InitializeComponent();  
        dockingManager1.Resize += new EventHandler(dockingManager1_Resize);  
    }  
          
    void dockingManager1_Resize(object sender, EventArgs e)  
    {  
        dockPanel1.Size = new Size(200, 0);  

    Please also set MinSize and Width properties to 200 in design time for left panel.

    I hope this was helpful. If you have additional questions, please contact us.

    All the best,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 17 Jan 2008 Link to this post

    Hi,

    yes this works with a fixed size.
    >>Seems to be a workaround for fixing the "MinSize" problem.
    BUT - how to enable a user to change the size (dragging the seperator with the mouse) - and use this "user set size" as new value in the handler for Resize?

    Is there an event for "drag resizeing" or can I filter out that the resizeing of a panel was done by user interacition on the panel - or by "autosize" in your code when changeing the window size at all.

    Regards

    Manfred
  7. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 17 Jan 2008 Link to this post

    Hi,

    I thought I got a solution by handling the "SplitterMoved" event.
    What I wanted to do was to set the value used in setting the panel size.
    >>the 200 you used in your snippet

    So my code looks like this:

            private void rdmMain_Resize(object sender, EventArgs e) {  
                dpMenu.Size = new Size(m_nCurSize, 0);  
            }  
     
     
            private void rdmMain_PrimarySiteComponent_SplitterMoved(object sender, SplitterEventArgs e) {  
                m_nCurSize = e.SplitX;  
            }  
     

    But it seems as if the value of e.SplitX in this event is the "value before" like described in this post:
    http://www.telerik.com/community/forums/thread/b311D-bbtcak.aspx

    So how do I obtain the correct splitter value after it was moved?

    Regards

    Manfred
  8. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 18 Jan 2008 Link to this post

    Hi Manfred,

    Thank you for getting back to us.

    The initial issue you reported was rescheduled for our 2008 Q1 release. In response to your particular situation, at this time you can use SplitterMoving event:

    void rdmMain_PrimarySiteComponent_SplitterMoving(object sender, SplitterCancelEventArgs e)  
    {  
        if(e.SplitX >= 198 && e.SplitX <= 202)  
        {  
             e.Cancel = true;  
        }  

    I hope this was helpful. If you have any additional questions, please contact us.

    Best wishes,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 18 Jan 2008 Link to this post

    Hi,

    the second solution is not really heplfull becaus on splitter moving (whith the mouse) your "MinSize" works.

    The problem comes up with dockingManger:Resize (user changes window size).

    Why I tried to handle Splitter Events was to change the value at which I have to "freeze" the panel.
    But the Splitter moved does not bring up the corrtect values due to a bug.

    Anyhow - I'm behind a solution using
    e.X instead of e.SplitX (which brings wrong values in SplitterMoved).

    My current workaround is (SplitterMoved):
    Check if e.X is smaller than MinSize - if NOT then I set a variable to the e.X value.
    Else I set it to MinSize.

    This check must be done since the user is able to drag furhter to the left with the Mouse than MinSize is.
    The splitter (correctly) stops - but the mouse moves on.

    My workaround looks now like this:
            private void rdmMain_Resize(object sender, EventArgs e) {  
                dpMenu.Size = new Size(m_nCurSize, 0);  
            }  
     
            private void rdmMain_PrimarySiteComponent_SplitterMoved(object sender, SplitterEventArgs e) {  
                if (e.X > dpMenu.MinSize) {  
                    m_nCurSize = e.X;  
                }  
                else {  
                    m_nCurSize = dpMenu.MinSize;  
                }  
            }  
     

    This mostly does what it should - I guess I have to check the MinSize of the rigth panel also - but this will not be a problem.

    Regards and thanks for your response

    Manfred
  10. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 18 Jan 2008 Link to this post

    UPDATE:
    I check if I could use "SplitterMoving" for my needs (set the variable).
    But this event has the same problems as "SplitterMoved".

    a.) SplitterMoving fires only once!!! (I tried to run a "moving display" - only one value came in
    --even if draging very slow
    b.) It shows the "old" value in e.SplitX

    So the same problem as with SplitterMoved.

    Regards

    Manfred
  11. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 18 Jan 2008 Link to this post

    Hello Manfred,

    We have added these issues to our TODO list. They will be addressed in the Q1 2008 release.

    Thank you for all your suggestions and feedback.

    Regards,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for WinForms is Visual Studio 2017 Ready