New Posts New Posts RSS Feed: Trigger same validation on two properties ...
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Trigger same validation on two properties ...

 Post Reply Post Reply
Author
as123 View Drop Down
Newbie
Newbie


Joined: 27-Apr-2010
Posts: 30
Post Options Post Options   Quote as123 Quote  Post ReplyReply Direct Link To This Post Topic: Trigger same validation on two properties ...
    Posted: 10-Dec-2010 at 4:02pm
          Is it possible to trigger a specific validation based on two properties, but mark only one of the properties as in error on the client? 

          For example, let us say we have FromDate and ToDate properties on an entity. Is it possible to trigger validations when either FromDate or ToDate is changed (which of course, is possible), but notify only ToDate in either case so that only ToDate is shown as in error. Is there any trigger setting which can accomplish this? 

          Currently (DevForce 6.0.6), both properties are shown with error marking (red box around - INotifyDataErrorInfo) on the silverlight client, and the ValidationSummary (Silverlight control) reports the same error twice as both properties are in error.

Thanks
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 13-Dec-2010 at 6:05pm
as123;

If I understand correctly, it sounds like what you're trying to do is more of a UI thing than DevForce. You might want to take a look at INotifyDataErrorInfo interface and see what event handler you can customize to achieve what you want to do. 

Also if you're binding to a DataGrid, each cell's error is handled by the following: 

"The DataGrid supports cell-level property validation and row-level object validation. If a validation exception is encountered in the property setter, the cell editing control displays its error state. The DataGridCell.IsValidDataGridRow.IsValid, and DataGrid.IsValid properties are all set to false. The DataGrid will not exit cell editing mode until the validation error is resolved."

This means that you can set DataGridCell.IsValid to true to override the error marking.

Hope this helps.
Back to Top
as123 View Drop Down
Newbie
Newbie


Joined: 27-Apr-2010
Posts: 30
Post Options Post Options   Quote as123 Quote  Post ReplyReply Direct Link To This Post Posted: 14-Dec-2010 at 3:01pm
          Thanks.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down