I need a little help...
I have an editable RadGrid. I invoke a command when the user finishes editing a row. The command saves the edited item. I have accomplished this using the Interactivity assembly, and add an event trigger on the RowEditEnded event. The InvokeCommandAction invokes a command and passes the SelectedItem as the commandparameter. The viewmodel then saves the parameter object. (the edited item)
This works as expected.
However, when the grid is sorted or filtered, under certain circumstances the command parameter (the SelectedItem) is NULL.
Specifically, if the change the user makes causes the edited row to be moved or removed in the grid.
Ex. If the Grid is sorted on Column A, and the user edits a value in Column A that causes it to be moved up or down. The Command is fired, but the parameter (SelectedItem) is NULL.
Thoughts on how I could solve this?
Thanks,
Justin
I have an editable RadGrid. I invoke a command when the user finishes editing a row. The command saves the edited item. I have accomplished this using the Interactivity assembly, and add an event trigger on the RowEditEnded event. The InvokeCommandAction invokes a command and passes the SelectedItem as the commandparameter. The viewmodel then saves the parameter object. (the edited item)
<
i:Interaction.Triggers
>
<
i:EventTrigger
EventName
=
"RowEditEnded"
>
<
i:InvokeCommandAction
Command
=
"{Binding SaveSelectedProjectCommand}"
CommandParameter
=
"{Binding ElementName=grdProjects, Path=SelectedItem}"
/>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
This works as expected.
However, when the grid is sorted or filtered, under certain circumstances the command parameter (the SelectedItem) is NULL.
Specifically, if the change the user makes causes the edited row to be moved or removed in the grid.
Ex. If the Grid is sorted on Column A, and the user edits a value in Column A that causes it to be moved up or down. The Command is fired, but the parameter (SelectedItem) is NULL.
Thoughts on how I could solve this?
Thanks,
Justin