Silverlight: GridSplitter with a collapse button – BEST
July 10, 2010 15 Comments
I don’t remember where I took this control from.
It is not my work so I cannot take credit for it.
I have only fixed some stuff and made some changes to the animation.
This is by far the BEST version of this control! Use this one!
All credits goes to the anonymous developer who made it.
it should go into the Toolkit.

It looks to me like you did it:
http://shemesh.wordpress.com/2008/11/18/silverlight-gridsplitter-with-a-collapse-button/
got that from a search at SilverlightCream
-Dave
well.. me too have written a version of this control which you can see here in oldest posts.
but this version of the Grid Splitter I did not write.
I have found it somewhere and been using it since then.
it is the best version.
Shemesh,
How would I get my column to automatically collapse at application launch time? Right now it is expanded by default. Thanks …
Andy
Andy, did you find a way to manage this? I have recently found and started using this control and am faced with the same problem. Anybody else have a suggestion?
Not yet, but I shelved it for a while when I couldn’t figure it out. I just started looking at it again yesterday. I’ll let you know if I have a breakthrough, but hopefully someone else out there has skinned this cat and will let us know how it’s done.
James,
This code seems to work, but only after everything has been loaded – like on a button click or something. I get weird results when trying to put it in the main page loaded event, but I think I’m on the right track.
gsTabTools.GridSplitterButton_Checked(this, null);
gsTabTools.IsCollapsed = true;
This is exactly what I was looking for except…
I wish I could use this in WPF (.NET 3.5) but so far after attempting to port it I ran into an issue because GridSplitter doesn’t implement the Visual States in .NET 3.5 because VSM is only available within the WPF Toolkit. Also I think there maybe other compatibility issues with the port because I’m not even seeing the button in my splitter.
I’ve started the following StackOverflow question in order to see if I could figure out an implementation that will work for .NET 3.5.
http://stackoverflow.com/questions/3673987/gridsplitter-with-button-for-pinning-like-behavior
Pingback: GridExpander for WPF « freekinputer
Hi,
I am using your control..
The issue i am facing while changing the default behaviour in your given sample is:
On changing the CollapseMode=”Previous” for vertical splitter in demo code, the splitter seems to go out of view when dragged to right area of browser window.
The weird issue occure when once you click the collapse/expand button.
can you check if this is bug or i need to change any other property.
Thanks.
Is there a way to expand/collapse the gridsplitter from the click event of another control?
Here’s the code I use to expand it programmatically. gsTabTools is the name of the grid splitter …
if (gsTabTools.IsCollapsed)
{
gsTabTools.GridSplitterButton_Unchecked(sender, e);
}
Andy,
No dice. Basically I have a method that runs and at the completion if the grid splitter is not expanded, I want it to expand. (I changed my UI slightly from a button click as my previous post eluded to).
I can easily enough use the “isCollapsed” property to check the state of the splitter, but if it is Collapsed (returns True) how can I expand it? It’d be nice to have an expand method but there doesn’t seem to be one.
Thanks,
Andrew
I must say fantastic ! I have not used it in my project till now but it will be very helpful to me in very near term. I am very happy seeing your blog post and I appreciate your efforts. You are taking active interest to make it more beautiful.
Hi! Thanks very much for posting this code! It’s exactly what I needed in the project I am working on. I am completely stuck on one thing though. I want two panes (on the right and left) and for some reason the pane on the right still has the pane below it. What is needed to remove the place holder for the bottom right pane? There appears to be a ghost pane or something.
Pingback: Silverlight Gridsplitter | Adam Estrada