This question is locked. New answers and comments are not allowed.
Hi. I have some trouble.
Briefly...
I'm using:
- Silverlight
- MVVM
- RIA
- RadGridView (2010.2.0714 (July 14, 2010))
- Editing entity in Modal Dialog (RadWindow)
- Modal Dialog content is DataForm (Silverlight toolkit)
Grid XAML:
MVVM method EditEntityCommand:
remark: this.BridgeContext = DomainContext (RIA)
Everything work fine, BUT!!!
If I make error in DataForm, I'll see the red validation mark (and in gridview too), that is ok. But when I click Cancel button on ModalDialog, the dialog will closed and this.BridgeContext.RejectChanges. But the gridview stay marked error (see attached images), however, DomainContext has no errors.
Help to fine solution!!! PLEASE!!!
Briefly...
I'm using:
- Silverlight
- MVVM
- RIA
- RadGridView (2010.2.0714 (July 14, 2010))
- Editing entity in Modal Dialog (RadWindow)
- Modal Dialog content is DataForm (Silverlight toolkit)
Grid XAML:
...
xmlns:grid="clr-namespace:Bridge.Helpers.Grid"
xmlns:clb="clr-namespace:Calabonga.Silverlight.Framework;assembly=Calabonga.Silverlight.Framework"
...
<
telerik:RadGridViewGrid.Row="1"
EnableColumnVirtualization="True" EnableRowVirtualization="True" ActionOnLostFocus="CancelEdit" SelectedItem="{Binding Path=SelectedItem, Mode=TwoWay}" ItemsSource="{Binding ElementName=Source, Path=Data}" grid:RadGridViewHelper.ColumnsCollection="{Binding Path=ColumnsCollection}" AutoGenerateColumns="False"> <i:Interaction.Triggers> <i:EventTrigger EventName="Deleting"> <clb:EventToCommand Command="{Binding Path=DeleteEntityCommand}" IsSendEventArgsToCommand="True" /> </i:EventTrigger> <i:EventTrigger EventName="RowActivated"> <clb:EventToCommand Command="{Binding Path=EditEntityCommand}" IsSendEventArgsToCommand="True" /> </i:EventTrigger> <i:EventTrigger EventName="AddingNewDataItem"> <clb:EventToCommand Command="{Binding Path=AddEntityCommand}" IsSendEventArgsToCommand="True" /> </i:EventTrigger> <i:EventTrigger EventName="Filtering"> <clb:EventToCommand Command="{Binding Path=FilteringCommand}" IsSendEventArgsToCommand="True" /> <clb:EventToCommand Command="{Binding Path=UpdateDDSFilterCommand}" CommandParameter="{Binding ElementName=Source}" /> </i:EventTrigger> </i:Interaction.Triggers> </telerik:RadGridView>MVVM method EditEntityCommand:
ModalDialogWorker mdw = new ModalDialogWorker(); RadWindow dialog = new ExtendedRadWindow(); IModalView view = new PersonDialogModalView(); dialog.Header = ApplicationStrings.DialogEditingTitle; Person person = (Person)this.SelectedItem; GridViewCell grid = ((GridViewCell)e.OriginalSource); ModalViewContext<Person> cntx = new ModalViewContext<Person>(Dictionary.List, person, new PersonViewModel()); mdw.ShowDialog(dialog, view, cntx, p => { if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { this.BridgeContext.SubmitChanges(); } else { this.BridgeContext.RejectChanges(); } });remark: this.BridgeContext = DomainContext (RIA)
Everything work fine, BUT!!!
If I make error in DataForm, I'll see the red validation mark (and in gridview too), that is ok. But when I click Cancel button on ModalDialog, the dialog will closed and this.BridgeContext.RejectChanges. But the gridview stay marked error (see attached images), however, DomainContext has no errors.
Help to fine solution!!! PLEASE!!!