I am using Telerik controls for Silverlight 5.
I need to set the Unique key validation for a cell.
On the "CellValidating" event, I am sending the cell value to the database and checking the value.
Here the problem is with the asyncronous Domain service.
I am using the MVVM architecture and Domain service. I have implemented the "CellValidating" event in the view model and in that event I am calling the service method as below.
GridViewCellValidatingEventArgs e = (GridViewCellValidatingEventArgs)((Emps.ExtendedCommandParameter)(obj)).EventArgs;
var currentColumn = e.Cell.Column
//pointer to the cell's column
//both are present
var newData = e.NewValue ==
//get the new value
var oldData = e.OldValue ==
//get the old value
(currentColumn.GridColumnIsUnique && newData !=
, operation =>
//e.ErrorMessage = "This is unique"; //set the error massage
//e.IsValid = false;
And the opearation completed method is as below:
sender, EventArgs e)
//We can get the value here
Here the problem is, we can know whether it is unique or not in the opration completed event,
but there I cant set the error message as I cant access that cell there.
How can I set the error message to that cell in the operation completed event.
Or is there any way I can get the value from the domain service, in the CellValidating event itself.
FYI: I am returning a scalar value from the domain service.