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

Closing the RadPane with a Close button on Header

2 Answers 216 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Aasiya
Top achievements
Rank 1
Aasiya asked on 02 Jan 2012, 07:27 AM
Hi,

I'm working on Sliverlight 4 with Prism 4. We are using RadDocking with RadPaneGroup. I've used the 'PaneGroupExtensions' given in this link for MVVM pattern
- http://www.telerik.com/community/forums/wpf/docking/caliburn-mvvm-raddocking.aspx
We are using RadControls for Silverlight Q2 2011.

Here is my xaml code :

<telerik:RadDocking>
        <telerik:RadDocking.DocumentHost >
                    <telerik:RadSplitContainer>
                        <telerik:RadPaneGroup  Name="RadPaneGroupMain"  
                                             local:PaneGroupExtensions.ItemsSource="{Binding InnerPanes}" 
                                             local:PaneGroupExtensions.ItemTitleDisplayMemberPath="Header">

                          <local:PaneGroupExtensions.ItemHeaderTemplate>
                                 <DataTemplate>
                                     <StackPanel >
                                           <TextBlock Text="{Binding Header}"  />
                                            <telerik:RadButton x:Name="CloseButton"  Command="{Binding CloseCommand}" />
                                       </StackPanel>
                                    </DataTemplate>
                         </local:PaneGroupExtensions.ItemHeaderTemplate>
           
                         <local:PaneGroupExtensions.ItemContentTemplate>
                                  <!--  -->
                          </local:PaneGroupExtensions.ItemContentTemplate>

                    </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking.DocumentHost>
   </telerik:RadDocking>

Its working fine. But i'm facing a problem while closing the RadPane. As shown in xaml, I have a HeaderTemplate for RadPane with a textbox and close button. When user clicks on close button Pane should be removed and also i need to remove the corresponding model object from the collection "InnerPanes". So instead of using the "RadDockingCommands:Close" , I used our own command to remove the model object. In Command method, I'm removing the model object from the "InnerPanes" collection object in my viewmodel class, so automatically "PaneGroupExtensions" code is taking care of removing the RadPane from RadPaneGroup. Both model object and corresponding Pane are getting removed but an error is getting raised  - "Value does not fall within the expected range."

Stacktrace of the error is :

"   at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
   at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)
   at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual)
   at System.Windows.UIElement.TransformToVisual(UIElement visual)
   at Telerik.Windows.Controls.ApplicationHelper.TransformToScreenRoot(UIElement target)
   at Telerik.Windows.Controls.WindowHost.GetGlobalMousePosition(UIElement target, MouseEventArgs e)
   at Telerik.Windows.Controls.InternalWindow.DragBehavior.OnElementLostMouseCapture(Object sender, MouseEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)"

Could you please help me to resolve this issue?

2 Answers, 1 is accepted

Sort by
0
Aasiya
Top achievements
Rank 1
answered on 08 Jan 2012, 06:26 PM
Hi,

Any update on this?
0
Aasiya
Top achievements
Rank 1
answered on 16 Jan 2012, 11:08 AM
Hi,
I'm waiting for response.., can you please help?
Tags
Docking
Asked by
Aasiya
Top achievements
Rank 1
Answers by
Aasiya
Top achievements
Rank 1
Share this question
or