Validating length of textbox in datagrid
Error Template property and its Value to our very own Control Template.
Now when we run this again, we still get our Tool Tip when we hover over the control, but now we’re also overlaying the control with Text Block we defined in our Control Template.
No problem, we can stick this Style into the Application. We can also specify that the Target Type=”Control” and then we can declare additional styles for the rest of our controls and base them on this one.
We also want to place a Text Block over the Ellipse whose Text is an exclamation point (the animation will run on this as well).
And since I want to place these the right-hand side of the control by setting a negative left margin, I’m going to want to also set the Tool Tips of the Ellipse and the Text Block so that if the user hovers over the error glyph it will display the Tool Tip as well.
The control is drawn with a red border indicating there is a problem, however no message is displayed. Prepare for your tech support phone lines to light up if you release this baby.
Specifying a Custom Validation Style We obviously want to let the user know what needs fixing here.
I showed how to do this with LINQ to SQL classes in this post where I set it up in a base business class.