This is a continuation of my last post.
I have made a better version of my ExtendedGridSplitter, this one works in both horizontal and vertical placement, I have made it more reliable and easy to work with.
Plus… I have found this post about animating Grid columns & rows and implemented it in my sample application.

January 19, 2009 at 21:57 |
I have tried your ExtendedGridSplitter. It works great as written, but I ran into a problem when I split it out into a UserControl. In your example, you are using it on your main page. However, there seems to be a SilverLight problem with finding the name of the page if you separate it into a UserControl of it’s own. You shouldn’t have any trouble reproducing this. Any recommendations?
February 5, 2009 at 21:41 |
I have the same problem as GEB, I put your code in a userControl that I use in a contentPresenter and it doesn’t seem to find the RowHeight because of it.
March 4, 2009 at 22:52 |
Hi Shemesh,
i am trying to add the one more column on right and like to have gridsplitter with the column . Gridsplitter should function in a same way as its working in your example on left . how can i achieve the same result on right side so If I have three column then I should have two horizontal gridsplitter one on left one on right and on mouse click on right gridsplitter its collapse and expand. (As its working on left column in your example project )
Thanks.
March 5, 2009 at 09:32 |
Futurem,
if i understand correctly you want to add one more vertical splitter that will collapse an additional column to the right side?
this should not be a problem:
add the columns and splitter and handle the splitter button event.
you already have the general idea in my code – adapt it !
March 10, 2009 at 13:46 |
Hi,
I have tried your ExtendedGridSplitter and it works fine.
I have one query, in your project you have created themes folder which has generic.xaml. When I was trying to add your code in our project (which was having theme folder already)so I added generic.xaml in theme folder but it was not working but when I added that in themes folder it works fine.
What I want to know is where you are setting the path for generic.xaml as it was just a matter of one “s” for folder name.
Can you please tell me so that I can have only one theme folder and not two (theme and themes)
Thanks.
March 11, 2009 at 10:28 |
Varsha,
“There are 2 significant breaking changes in how you handle the file generic.xaml…” “…The first change is that the file itself has a new location inside the Themes folder…”
http://silverlight.net/blogs/jesseliberty/archive/2008/09/27/skinnable-custom-controls-change-to-generic-xaml.aspx
July 22, 2009 at 09:01 |
I have downloaded your Gridsplitter and works on its own fine. However when I attempt to incorporate it I keep getting a compile error..
Error 13 No overload for ‘VGridSplitter_ButtonClick’ matches delegate ‘CollapseButtonClickEventHandler D:\Application\MainPage.xaml
and also..Error 14 No overload for ‘HGridSplitter_ButtonClick’ matches delegate ‘CollapseButtonClickEventHandler….
The Delegate and Event are exactly as per the original. I just wondered if you knew what may cause this. As I have spent quite a lot of time trying work out why?
Regards
Mark
July 22, 2009 at 09:54 |
your event handler should look like this:
private void VGridSplitter_ButtonClick(object sender)…
July 22, 2009 at 11:02 |
As per orignal in the Page.cs
private void VGridSplitter_ButtonClick(object sender)
{
..
}
and in the Extender Code..
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
VerticalCollapseButton = this.GetTemplateChild(VerticalCollapseButtonElement) as Button;
if (VerticalCollapseButton != null)
{
VerticalCollapseButton.Click += new RoutedEventHandler(OnCollapseButtonClickEvent);
}
Event wired as follows…
public delegate void CollapseButtonClickEventHandler(object sender);
public event CollapseButtonClickEventHandler CollapseButtonClickEvent;
void OnCollapseButtonClickEvent(object sender, RoutedEventArgs e)
{
if (CollapseButtonClickEvent != null) CollapseButtonClickEvent(sender);
}
Any ideas? Have I missed something? To be honest I’m not that familiar with ‘Routed Events’.
Regards
Mark
July 22, 2009 at 14:13 |
its very hard to tell, seems like you are doing everything right.
one thing i have noticed in your first response is on ‘Error 13′ it shouts on MainPage.xaml and on your second post you write Page.cs – could be your xaml code and event handler are not on the same page?
other then that i will need to see more of your code.
July 22, 2009 at 14:21 |
I’m dumbfounded as to why it does this, as its exactly how it is in the original source. However I have found a workaround and that is to pass the RoutedEventArgs as an extra parameter right through into the actual onlclick method as well delegate declaration – it then compiles and runs fine. I’ve spend the best part of the day on this, thus at this stage I’ll accept a superfluous parameter. Hopefully this will help anyone else who strikes a similar problem and give them a quick way forward, even if it isn’t perfect.
Thanks
Mark
July 29, 2009 at 08:42 |
really happy i found this post – was having the exact same issue. building the gridsplitter_collapse project yielded no problems but after moving it into my Prism app, i received those 2 errors. i ended up adding the ExtendedGridSplitter.cs class to an assembly where i put common controls. I added the themes/generic.xaml there and copied in the styles that were in App.xaml of the original solution (make sure to put them BEFORE the existing style definitions in generic.xaml or you get AG_E_UNKNOWN_ERROR at runtime). I made the edit to the click handler and delegate definition and it now works. Will dig into this some more as time permits but hopefully this can help someone else who wants to use this really cool control. btw – thanks for your control, shemesh….
September 3, 2009 at 14:41 |
Hi Mark and Shemesh.
I need use too GridSplitter_Collapse_V2, but in my app i get AG_E_UNKNOWN_ERROR at runtime. What i need change in my work for the gridsplitter work?
Tks!!
November 10, 2009 at 20:27 |
doesn’t appear to work when converted to 3. Is there an easy “click” solution, without the animation?