C maskedtextbox validatingtype
This custom Data Grid View column control is contained in 3 classes...
A Column control that inherits from Data Grid View Column, a Cell control that inherits from Data Grid View Text Box Cell, and an Editing Control that implements the IData Grid View Editing Control interface The Masked Edit Column class is fairly straight forward; it only overrides one property (to ensure that the correct cell type it used).
You can use a Data Grid View Combo Box Column to act a as "look up table" to show a user friendly version of the field, rather than just a numeric equivalent.
Let's say that you have a Microsoft Access database that you plan to use in your program. For example, all columns are aligned to the left and have have no formatting.
For example, you could create a new column type that supports the Masked Edit feature found in the Masked Text Box control.
This new custom column type would be very useful when trying to prevent input errors.
Value Member = "Category ID" ' the numeric value to look up in the "child" table dgvc.
Display Member = "Category Name" ' the column value you want displayed dgvc. Get Data() ' the child table ' some more tweaking dgvc. Automatic ' insert the new column at the same location Data Grid View1. Insert(index, dgvc)) Now the user can select the user-friendly Category strings and also is prevented from selecting a value that's not a valid Category ID If the 5 built-in column types is not sufficient, it is fairly easy to add a custom column type yourself.