Welcome to WindowsClient.net | My Blog | Sign in | Join

Windows Client Videos

How Do I: Control Item Activation By Data Validation?

Being able to better control access to functionality within a UI is part of better UI design. In this video, Todd Miranda demonstrates how to enable or disable UI functionality based on the validation of data.

Author: Todd Miranda 

 

Comments

gege said:

This is a very nice code, thanks.

Now, I have a small problem: I added a custom validation on the first Name field that checks if the field is empty. That works fine. But if the field is initially empty, then the Save button is enabled when the window is opened, and that is not correct. If I type some text in the Name field and then remove it, the button is disabled.

In other words, how can I trigger the validation checks on the window loading?

# April 21, 2010 5:23 PM

gege said:

I just found the ValidatesOnTargetUpdated attribute (in 2008 SP1) that solves my problem.

# April 21, 2010 5:50 PM

anhurtado said:

Excelente tutorial me podrías ayudar con algo? quiero validar los datos que se introducen directamente en la intefaz del usuario como lo haces en el video pero utilizando mi modelo de datos (EDM) Entity Data Model como podría hacerlo? Muchas Gracias.

# August 25, 2011 1:11 PM