title: .NET Validation pattern
body: <p>I've never looked much into all what .NET offers for user input validation because to start with I dislike the way they will typically not let you unfocus a control unless you enter the right data (I believe the <code>DataGridView</code> does this).</p>
  
  <p>On the other hand, I found that I often need to validate what I'll describe below and I wonder if sticking to .NET standards here will make it any easier.</p>
  
  <p>I'll typically have a dialog box that among other controls will have two combo boxes: one to select a data table among existing tables, and one to select a column among the columns in the currently selected table. This is easy enough so far, but since this is a dialog, I need to show the values that were selected the last time the dialog was shown if they still exist in the database, or otherwise select some other column if the table still exists, or select another table and column if there is any table and warn the user that his selection has changed, or if there are no tables simply show a message and close the dialog.</p>
  
  <p>Of course this is not the only case. Sometimes it will be a bit more complex and every time I will try to figure out <em>again</em> what's the best way to handle it. I wonder if there is already a pattern, particularly one that .NET offers I can apply to the case I describe above? If so, I'm sure I'll figure out how to apply it to other cases.</p>