Hi all,
I have a question regarding the WinSplitter control.
If I understood the docs right the splitter collapses the panel that has the same docking as the splitter.
So a main-panel hosts the first panel docked bottom, then the splitter docked bottom and last another panel docked Fill.
In this case the panel that is docked bottom gets collapsed.
So far so good, but I am unable to change this to make the top panel gets collapsed.Even if I undock all panels and then redock them in the right order it does not work.
The only solution I figured out was to remove the hostin panels (top, bottom) and the splitter and then start over again docking the top panel first, then the splitter (dock top) and last the panel that gets docked Fill.
Even if I undock them all, remove the splitter, move the panels out of the main panel and try over again I can not archive what I wanted, invert the collapsed panel...
Is there a solution for this problem I am missing?
any help is kindly appreciated.
best regards
Andy
Hello Andy,
Could you please review the sample attached to this post and see if it meets your requirements.Please feel free to let me know if I misunderstood you or if you have any other questions.
Hi Boris,thanks for looking into this. I posted this a while ago but the problem is still there.The sample attached shows how to use the splitter, that is fine, nevertheless it doesn't solve my problem.
What I try to do is to change the orientation of the splitter after it is already in place.You can reproduce this by doing the following:
- add an UltraPanel to the form- dock it bottom- add an UltraSplitter to the form- dock it bottom (so this will make the bottom panel collapse if the splitter is clicked)- add another Ultrapanel- dock it fill
So now we have two areas where the bottom one collapses when the splitter is clicked.
What I want to do now is to make the top panel collapse.If I just change the docking of the two panels and the splitter it doesn't work.Especially if I dock the formertly bottom docked panel to "fill" it takes up the whole area...
The only way to do this at my knowledge is to remove both panels and the splitter and start all over again, which might be tricky if there is already a lot of content on the form.
I hope that clarifies my problem, let me know if you need further info.
best regardsAndy
After taking some time researching this I could suggest you to use the 'WinExpandableGroupBox' control.
Could you please clarify it would be suitable in your scenario. If I got you right, It might be enough for you to use two instances of this control and change the position of the first based on the state of the other expandable box.
Hi Boris,honestly I prefer having the panels and the splitter due to certain setup issues.It works pretty fine if you do it correctly in the first place. But in real life sometimes the superiors want it exactly the other way than it was implemented (they do not want a GroupBox neither).
But the efforts that are necessary to change the collapsing panel is often quite huge, especially if its a later stage of a project.
I thought that undocking both panels and the splitter and then redocking them correctly would do the job, but its impossible to make them work correctly after they have been docked the first time.Try it yourself, the panel that is docked to "Fill" always takes up the complete space if you try to redock them.The only solution I found was to undock them, create new panels, copy the content of the old panels to the new ones, remove the old panels/splitter, add a new splitter and then dock the new panels in the right order. Give it a try and you'll see.
This approach is extremely painfull, especially if the panels already contain complex UI elements.
If the redocking would work I would be happy ;)
Please be so kind and check this out and let me know what you think.
cheersAndy
Please check the sample in this post and let me know if we are on the same page about the wanted behavior.
Hi Boris,I really appreciate the efforts you are taking to help me out here.Nevertheless I don't think that a sample will be necessary. I am looking for a way to change the collapsing panels if they are already positioned using the designer of Visual Studio.
I checked your sample and I am pretty sure that you have changed the collapsing panel here.It show one of the odd behaviors when doing that.
Please be so kind and do the following with the sample you have provided.
- open the form in Visual Studio Designer- mark the red (lower) panel by clicking it- now you see the borders of the panel, which are correct. It only fills the area below the splitter, that is fine.
Now comes the odd part:
- mark the upper (yellow) panel by clicking it.- now you can see that the borders of the upper panle take up the complete form. Which is wrong and will cause overlappings with a more complex UI than with one that only contains a button.
This happens if you manually change the docking after it has ben done initially (the first time)The lower border of the yellow panel should only go down to the splitter and should not take up the complete form.
This is what I was talking about, that happens when you undock and redock panels/splitter in order to change the collapsing panel.As mentioned, this happens always and the only way to work around is recreating all the panels and the splitter.
I hope I was able to clarify my concerns, please be so kind and let me know if you need further information.cheers and thank you for your supportAndy
You could try using the following code(ultraPanel1 is docked fill in Form1 and everything else is in it):
if (ultraSplitter1.Dock == DockStyle.Bottom) { this.ultraPanel1.ClientArea.Controls.Clear(); this.ultraPanel1.ClientArea.Controls.Add(this.ultraPanel3); this.ultraPanel1.ClientArea.Controls.Add(this.ultraSplitter1); this.ultraPanel1.ClientArea.Controls.Add(this.ultraPanel2); ultraPanel2.Dock = DockStyle.Top; ultraPanel3.Dock = DockStyle.Fill; ultraSplitter1.Dock = DockStyle.Top; } else { this.ultraPanel1.ClientArea.Controls.Clear(); this.ultraPanel1.ClientArea.Controls.Add(this.ultraPanel2); this.ultraPanel1.ClientArea.Controls.Add(this.ultraSplitter1); this.ultraPanel1.ClientArea.Controls.Add(this.ultraPanel3); ultraPanel3.Dock = DockStyle.Bottom; ultraSplitter1.Dock = DockStyle.Bottom; ultraPanel2.Dock = DockStyle.Fill; }
Please do not hesitate to contact us if you need any additional assistance.
Hi Andy,
Thank you. I am very glad to hear that you were able to solve this issue and to see such great feedback with screenshots and explanations from your side.
Please do not hesitate to contact me in the future with any kind of questions.
Hi Boris,dude, that was a long way, wasn't it?I never used the "Bring to Front" options on the splitter/panels. Now that I have seen what you are doing in the video and used "Bring to Front" on the panel/splitter everything behaves like I expected it to do and works perfectly fine ;)
I really appreciate your help in this case. This was one of the most amazing support performance I ever witnessed. You people at Infragistics really do a great job :)
Thanks again Boris and have a great weekend,best regardsAndy
Thank you for your feedback.
I realized that I might had to make a movie all the way from the creation of the project because you could have get confused by the steps I am showing in the previous movie, I now believe that in this case they are not giving enough information.
It is really my pleasure assisting you for this tricky scenario.
Please let me know if we finally got on the same page here.
Hi Boris,first of all I would like to say thank you for all the efforts. I haven't received a video in the past in order to get my problem fixed, I really appreciate the work you put into this.
I tried to follow the example you showed me in the video. There it works just as I'd like to have it.Unfortunately I am unable to reproduce it.I created some screenshots to show you what happens when I try the steps that are shown in the video.
This shows the main setup:
Here I reproduced changing the docking of the bottom panel from Fill to Bottom.It works just like in the video.
This is what happens when I change the docking of the splitter from Top to Bottom:
I gave it several tries but it never worked out.
Here is what I talked about beeing some "odd behavior"
The top-border of the bottom panel is right below the splitter, just as expected
The borders of the top-panel fill the complete form.This is not happening when creating the setup from scratch.Normally the bottom-border of the top-panel is just right above the splitter.In this case all content that is lower positioned than ultraButton1 (below the splitter) is hidden behind the bottom-panel.
I hope I could clarify my concerns. English is not my mother language, so I sometimes have problems expressing my thoughts ;)
cheers and thanks again,Andy
Could you please watch the movie from this post and let me know if this is good for you and if not - at which point is the odd behavior coming out. If this movie does not represent the problem you could try to send me a movie which is showing the mentioned behavior as I am already a bit confused about the things you are explaining.