RadDocking

7 posts, 0 answers
  1. Jegan
    Jegan avatar
    9 posts
    Member since:
    Jan 2015

    Posted 07 Jan 2015 Link to this post

    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?

     

  2. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 08 Jan 2015 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jegan
    Jegan avatar
    9 posts
    Member since:
    Jan 2015

    Posted 08 Jan 2015 in reply to Nasko Link to this post

    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?


  5. Jegan
    Jegan avatar
    9 posts
    Member since:
    Jan 2015

    Posted 08 Jan 2015 in reply to Nasko Link to this post

    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
  6. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 09 Jan 2015 Link to this post

    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.

     
  7. Jegan
    Jegan avatar
    9 posts
    Member since:
    Jan 2015

    Posted 09 Jan 2015 in reply to Nasko Link to this post

    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
  8. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 12 Jan 2015 Link to this post

    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.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready