DataFrom + DataGrid's SelectionChanged event issue

4 posts, 0 answers
  1. Tomasz
    Tomasz avatar
    4 posts
    Member since:
    Dec 2012

    Posted 16 Jul 2013 Link to this post

    Hi Telerik,
     
     I have an mvvm solution. In my viewmodel I have an QueryableCollectionView of the class "BaseClass" objects and an standalone "BaseClass" element(let's call it seletedElem). The "BaseClass" class have a private QueryableCollection of the "ChildClass" objects(let's call it SCollection), and a property that returns this collection. Both classes are implementing the following interfaces:  INotifyPropertyChanged, IDataErrorInfo, IEditableObject. In my view I have raddatagrid which itemssource is binded to the ObservableCollection of "BaseClass" objects from viewmodel and selected item is binded to the standalone "BaseClass" object - selectedElem.

    The Dataform is binded to the currently selected grid item in this way :

      ItemsSource="{Binding ElementName=xxx,Path=DataContext.seletedElem.SCollection}"

    Then before the first DataGrid's selection changed event, or after the new item is inserted to the grid, when I press add button of the raddataform the current item of the SCollection is always an empty item of type ChildClass, but after the grid's selection changed event(when one of the existing items is selected) the current item of the SCollection is always null and im not able to edit it's properties.

    Is there anyway to fix this behaviour?

    Regards,
    Tomasz
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 18 Jul 2013 Link to this post

    Hi Tomasz,

    I have tried to reproduce the behavior, but without any success. Will it be possible to take a look at the sample attached and let me know whether I am missing something ? What steps do I need to follow in order to get the same result as the one on your side ?  

    Regards,
    Maya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Tomasz
    Tomasz avatar
    4 posts
    Member since:
    Dec 2012

    Posted 18 Jul 2013 Link to this post

    Hi Maya,

       I wrote a descriptions for at least two workardounds for this problem under the following link http://stackoverflow.com/questions/17695228/queryablecollectionview-with-datagrid-and-dataform-selection-changed-issue/17702949#17702949

    I will look at your sample and then try find provide you an exact reproduction scenario.

    Regards,
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 22 Jul 2013 Link to this post

    Hello Tomasz,

    Ok, great. I will be waiting for the sample illustrating your scenario. If appropriate, you can use the one I previously sent.

    Regards,
    Maya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top