When coding a .NET transactional form, we end up putting the same piece of code in those forms over and over - the form state code.

Every form is different, but generally we use three form states = CLEAN, POPULATED, and DIRTY. We'll use an 'Item' form for discussions sake

  1. Clean is for when the form is newly opened. Generally every field on the form is disabled except the main lookup field and maybe a lookup button.
  2. Populated is when the user has selected an item, but has not edited anything. Generally the item number field would be disabled, but the lookup button would not be, and all the form fields would be enabled
  3. Dirty is when the form has been edited an it needs to be saved. Both the item number field and the item lookup button are disabled, all remaining fields are enabled.

We also have code to clear every field on the form.

Last, we have code to add event handlers to each field, so that when the field is edited the form will become DIRTY.


This article shows a sample Telerik RadGrid Hierarchical example

 This article contains template code to display Grid Footer Template and Detail Templates using a Telerik ASP.NET RadGrid. Sure, you can go to the documentation and get it... but that took me hours. Now I'll have it when I need it.



There are two techniques that we use to save grid data to the database. One involves trapping the UserAddingRow, UserDeletingRow, and CellEndEdit events and committing the data to the database immediately.

That technique doesn't work or is not appropriate on all forms, like on a form that would have multiple changes going on at one time. An order entry form would have a total field that changed as the quantity in the grid was updated. In that case we hold all the changes and commit them with the Save button.

This article is a code example of that technique.

Sometimes I'm in the Telerik Winform RadGrid AddingNewRow event and I need to completely cancel the new row.

e.Cancel only cancels the add, the new row is still populated.

The code sample below will do the trick.