This is a migrated thread and some comments may be shown as answers.

Maximum width

9 Answers 130 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Daniel Plomp
Top achievements
Rank 2
Daniel Plomp asked on 16 Nov 2007, 09:49 AM
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

9 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 16 Nov 2007, 03:07 PM
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
0
ManniAT
Top achievements
Rank 2
answered on 16 Jan 2008, 04:47 PM
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
0
Julian Benkov
Telerik team
answered on 17 Jan 2008, 01:09 PM
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
0
ManniAT
Top achievements
Rank 2
answered on 17 Jan 2008, 01:47 PM
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
0
ManniAT
Top achievements
Rank 2
answered on 17 Jan 2008, 02:43 PM
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
0
Julian Benkov
Telerik team
answered on 18 Jan 2008, 01:31 PM
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
0
ManniAT
Top achievements
Rank 2
answered on 18 Jan 2008, 01:51 PM
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
0
ManniAT
Top achievements
Rank 2
answered on 18 Jan 2008, 02:06 PM
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
0
Julian Benkov
Telerik team
answered on 18 Jan 2008, 02:31 PM
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
Tags
Dock
Asked by
Daniel Plomp
Top achievements
Rank 2
Answers by
Julian Benkov
Telerik team
ManniAT
Top achievements
Rank 2
Share this question
or