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

Floating pane loses bindings

7 Answers 183 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 28 Jul 2011, 12:36 AM
I have a RadGridView inside a RadPane. I'm using MVVM with a QueryableDomainServiceCollectionView in the ViewModel. When my RIA aplication starts data is shown in the grid. If I float the pane all the information in the grid disappears. I can then dock the pane and the data reappears.

See attached screenshots.

I tried the same program with 2011 Q1 SP1 and this problem didn't occur.

I also tried to put this into PITS but when I tried to add an issue it kicked me out.

7 Answers, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 01 Aug 2011, 06:02 PM
This is a very serious regression that I need help on.

Can someone please reply? Thanks.
0
bg
Top achievements
Rank 1
answered on 01 Aug 2011, 07:10 PM
I had the same issue. Telerik told me it was by design. They added a bug for me in their PITS system but will not fix this unless it gets enough votes.

You can add another vote for it here: http://www.telerik.com/support/pits.aspx#/public/silverlight/6689

FYI - This is only an issue if your are inheriting the DataContext. If the control has its own model thats not inherited you should be fine.
0
Scott
Top achievements
Rank 1
answered on 01 Aug 2011, 07:17 PM
Thanks bg, I added my vote.

Whether this is a 'bug' or not changing funcitonality that many depend on in a minor release isn't right.
0
bg
Top achievements
Rank 1
answered on 01 Aug 2011, 07:19 PM
I could not agree more. Thanks for the vote. Hopefully they will enable this down the road.
0
Scott
Top achievements
Rank 1
answered on 02 Aug 2011, 06:09 PM
bg - I tried setting the DataContext of the Docking control directly
DockingHome.DataContext = WebContext.Current.VMManager.ViewModel
and I still have the same problem. Is this what you mean by not being inhereited? It is the same viewmodel object as the whole view though.
0
bg
Top achievements
Rank 1
answered on 03 Aug 2011, 07:12 PM
Scott - Sorry for the confusion. If the Control has its own dedicated model it will work just fine, but is sounds like your using an inherited model which is trying to use the same model as its parent control. In this case I just re-bind the model as a work around. Use the PaneStateChange event on the rad docking control and rebing the model:
private void radDocking_PaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            foreach (RadPane pane in radDocking.Panes)
            {
                    if (pane.DataContext == null)
                        pane.DataContext = this.DataContext;
            }
        }

 

 

0
Scott
Top achievements
Rank 1
answered on 03 Aug 2011, 08:52 PM
thanks for the help bg, that worked great. I "enhanced' or LINQified the routine a little below in case you want to use it
private void DockingHome_PaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
    // work around functionality change in RadDocking where the DataContaxt is lost when floating the pane
    RadDocking dockingControl = (RadDocking) sender;
    IEnumerable<RadPane> nullContextPanes = dockingControl.Panes.Where(p => p.DataContext == null);
    // set the DataContext if it is null
    nullContextPanes.ToList().ForEach(p => p.DataContext = ViewModel);
}
Tags
Docking
Asked by
Scott
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
bg
Top achievements
Rank 1
Share this question
or