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

RadDocking

6 Answers 196 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Jegan
Top achievements
Rank 1
Jegan asked on 07 Jan 2015, 04:29 PM
Hi
I am trying to add collection of items into rad docking using the "dockingAndMVVM" example given on this post

http://www.telerik.com/forums/drag-amp-drop-docking-in-document-host

It is working good in adding multiple panes to the docking however I noticed that when an Item from the collection is updated, the update is not pushed towards the view.  The ItemSourceChanged event is only received when an Item is added or removed to/from collection but not when item is updated. Is there any work around for this?

 

6 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 08 Jan 2015, 02:57 PM
Hello Jegan,

Indeed the ItemSourceChanged event fires when a new item is added or removed from the collection. So, in order to update the UI as soon as a change of a particular property is made that property should raise PropertyChanged notification - the class in which those properties are declared need to implement INotifyPropertyChanged. However, you could also inherits the ViewModelBase class which implements that interface:

public string header;
 
public string Header
{
    get
    {
        return this.header;
    }
    set
    {
        if(this.header != value)
        {
            this.header = value;
            this.OnPropertyChanged(() => this.Header);
        }
    }
}

We hope this will help you.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jegan
Top achievements
Rank 1
answered on 08 Jan 2015, 03:24 PM
Hi Nasko,

I am using the "ObservableItemCollection" I thought by default this will fire the property changed event.
public ObservableItemCollection<MeasurementDataViewModel> Panes { get; set; }

<telerik:RadDocking Grid.Row="1"
                            HasDocumentHost="True"
                            HorizontalAlignment="Stretch"
                            Margin="0"
                            VerticalAlignment="Stretch"
                            CloseButtonPosition="InPane"
                            Close="RadDocking_Close">
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer IsTabStop="True" Orientation="Vertical" x:Name="SplitContainer">
                    <telerik:RadPaneGroup HorizontalAlignment="Stretch"
                                          VerticalAlignment="Stretch"
                                          TabStripPlacement="Bottom"
                                          dockingExtension:PaneGroupExtensions.ItemsSource="{Binding Panes}"
                                          >
                        <dockingExtension:PaneGroupExtensions.ItemContentTemplate>
                            <DataTemplate  DataType="{x:Type models:MeasurementData}">
                                <views:MeasurementsUserControl DataContext=""/>
                            </DataTemplate>
                        </dockingExtension:PaneGroupExtensions.ItemContentTemplate>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
        </telerik:RadDocking>


I am not sure why the change is not reflected?


0
Jegan
Top achievements
Rank 1
answered on 08 Jan 2015, 05:04 PM
Actually I've set "OnPropertyChanged" on the properties inside my ViewModel and it seem to update the values, however the view doesn't refresh in real time. I have to select a different Pane and come back to the required Pane for the view to updated on the screen.

Is it somewhere I should be calling a "Refresh()"?

Thanks
Jegan
0
Nasko
Telerik team
answered on 09 Jan 2015, 12:51 PM
Hi Jegan,

From the provided code snippet we could not tell for sure what may cause the described behavior - we have tested it and everything works as expected on our side. Please, check the attached video. What we could suggest you is to try to refresh the view of the ObservableCollection as shown bellow:

CollectionViewSource.GetDefaultView(this.myObservableCollection).Refresh();

If that doesn't work for you we will need some sample project that reproduces the issue, so we could be able to investigate it further.

Hopes this helps.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jegan
Top achievements
Rank 1
answered on 09 Jan 2015, 04:14 PM
Hi Nasko,
CollectionViewSource.GetDefaultView(this.myObservableCollection).Refresh();

The line of code you mentioned above did not work.  I will try to create a small example project for you.

Thanks
Jegan
0
Nasko
Telerik team
answered on 12 Jan 2015, 12:26 PM
Hi Jegan,

Please open a support ticket with the project attached, so we can check it on our side and think of possible solution.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Docking
Asked by
Jegan
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Jegan
Top achievements
Rank 1
Share this question
or