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

DataFrom + DataGrid's SelectionChanged event issue

3 Answers 87 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Tomasz
Top achievements
Rank 1
Tomasz asked on 16 Jul 2013, 04:27 PM
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

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 18 Jul 2013, 09:44 AM
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 >>
0
Tomasz
Top achievements
Rank 1
answered on 18 Jul 2013, 09:50 AM
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,
0
Maya
Telerik team
answered on 22 Jul 2013, 11:10 AM
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 >>
Tags
DataForm
Asked by
Tomasz
Top achievements
Rank 1
Answers by
Maya
Telerik team
Tomasz
Top achievements
Rank 1
Share this question
or