CSLA Validation

CSLA Validation

Old forum URL: forums.lhotka.net/forums/t/8081.aspx


alagesan posted on Wednesday, December 02, 2009

hi.,
i wrote all my validation codes in CSLA Bussiness layer
it will  validating when user leave from textbox  control or GridView Cell

but i want it fire when when user changing value in text box like Textbox_textChanged Event
but its firing only on TextBox_Leave Event
Will it possible to change it?

rsbaker0 replied on Wednesday, December 02, 2009

This behavior is because of the way the control posts data back to the bound object.

The validation rules will only fire in response to a property setter being called.

In WinForms, you can tell a control to post the valiue any time the property changes, which solves the problem for individual controls on forms. I'm not sure if there is an equivalent solution for the GridView, but if there is one, it will involve changing some setting of the GridView to force it to post the cell value to the bound object any time the cell value is changed.

Copyright (c) Marimer LLC