This question is locked. New answers and comments are not allowed.
Hello,
I have a RadGridView control bound to a CollectionViewSource.View. I also have the SelectedItem bound to a VM Property with Mode=TwoWay. I have a RadDataForm bound to the same collection as the RadGridView. When the Grid first comes up, everything is fine. When I select an item, things are fine. The selected item in the grid appears in read-only mode in the RadDataForm. When I click on the edit icon, change the value of a field, then click the Commit button the selected item moves to the row before the one I am editing but the highlighted row is the one I want to edit. Also in my command method, the selected item is not what I edited.
Properties of the RadGridView:
And here is the properites for the RadDataForm:
I have a RadGridView control bound to a CollectionViewSource.View. I also have the SelectedItem bound to a VM Property with Mode=TwoWay. I have a RadDataForm bound to the same collection as the RadGridView. When the Grid first comes up, everything is fine. When I select an item, things are fine. The selected item in the grid appears in read-only mode in the RadDataForm. When I click on the edit icon, change the value of a field, then click the Commit button the selected item moves to the row before the one I am editing but the highlighted row is the one I want to edit. Also in my command method, the selected item is not what I edited.
Properties of the RadGridView:
<telerik:RadGridView Name="significantActivities" VerticalAlignment="Top" HorizontalAlignment="Left" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserInsertRows="False" AutoGenerateColumns="False" AutoExpandGroups="True" IsReadOnly="True" ColumnWidth="*" ItemsSource="{Binding SignificantActivityCollection.View}" SelectedItem="{Binding SelectedSignificantActivity, Mode=TwoWay}">
Here is the code for SelectedSignificantActivity Dependency PropertyHere is the code in the Command method:public
Model.SignificantActivity SelectedSignificantActivity
{
get
{
return
_selectedSignificantActivity; ;
}
set
{
if
(_selectedSignificantActivity != value)
{
_selectedSignificantActivity = value;
// Update bindings no broadcast
RaisePropertyChanged(SelectedSignificantActivityPropertyName);
}
}
}
DataService.SaveActivity(result => DispatcherHelper.CheckBeginInvokeOnUI(() =>
{
if
(result)
{
}
}),
SelectedSignificantActivity);
And here is the properites for the RadDataForm:
<telerik:RadDataForm x:Name="dataForm" ItemsSource="{Binding SignificantActivityCollection.View}" AutoGenerateFields="False" CommandButtonsVisibility="Add,Edit,Cancel,Commit" LabelPosition="Above" ReadOnlyTemplate="{StaticResource significantActivityReadOnlyTemplate}" EditTemplate="{StaticResource significantActivityEditTemplate}" NewItemTemplate="{StaticResource significantActivityEditTemplate}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"><i:Interaction.Triggers> <i:EventTrigger EventName="EditEnded"> <mvvmLtCommanding:EventToCommand Command="{Binding EditSignificantActivityCommand}" /> </i:EventTrigger> </i:Interaction.Triggers> </telerik:RadDataForm>
Any idea why my SelectedSignificantActivity is not set to the item I am actually editing?