DataGridViewColumns .NET assembly (for VB.NET, C#, C++)

The DataGridView .NET control seems a lot better than DataGrid .NET 1.x control. It provides a powerful and flexible way to display a data source. You can extend the DataGridView control in a number of ways to build custom behaviors into your applications. Although you can create your own types of cells the Windows Forms DataGridView control is mostly column-based, rather than cell-based. As a result, to attain most tasks, you have to work with the columns, not the cells themselves.

Download demo-trial now!

DataGridViewColumns .NET assembly from RustemSoft is a DataGridView Columns software package specifically designed for .NET developers. The assembly allows you to use all strengths of the MS Windows .NET forms DataGridView control without waiving the user interface elements your customers need.
These Column classes are chock full of functionality that you won’t find in the standard Microsoft .NET DataGridView Columns, that make it easy to build professional and forcing user interfaces.

Order the DataGridViewColumns assembly

Hot Queston

Read the DataGridViewColumns assembly documentation

By using the assembly you can create your own set of DataGridViewColumn objects that defines custom column for the Windows Forms DataGridView control and add them to the GridColumnsCollection. A column is an object that defines what the column looks and behaves like, including such things as color, font, and the presence of controls that will handle linked field in a database with the use of a Combo Box, a DateTime format Box and other control.
Also we have built .NET code samples that describe the concepts and techniques that you can use to build DataGridView features into your applications.
The .NET Framework (2.0 and later) includes six types of DataGridView column classes by default: DataGridViewButtonColumn, DataGridViewCheckBoxColumn, DataGridViewComboboxColumn, DataGridViewImageColumn, DataGridViewTextBoxColumn, and DataGridViewLinkColumn classes.

Skater .NET Obfuscator
More about Skater .NET Obfuscator
Download Skater .NET Obfuscator
Order Skater .NET Obfuscator

Controls .NET assembly (WinForms)
More about RustemSoft.Controls.dll
Download RustemSoft.Controls.dll
Order RustemSoft.Controls.dll

DataGridColumns .NET assembly (Forms)
More about DataGridColumns.dll
Download DataGridColumns.dll
Order DataGridColumns.dll

RustemSoft DataGridViewColumns dynamic link library contains the following DataGridView Columns:

  • DataGridView Combo Column (extended combobox)
  • DataGridView Memo Column
  • DataGridView DateTimePicker Column
  • DataGridView DateTime Column
  • DataGridView Time UpDown Column
  • DataGridView Numeric Column
  • DataGridView Text Fractions Column
  • DataGridView Label Column
  • DataGridView Calculator Column
  • DataGridView DomainUpDown Column
  • DataGridView NumericUpDown Column
  • DataGridView Picture Column
  • DataGridView MaskedTextBox Column
  • DataGridView Print Class
  • DataGridView Combo column (extended combobox)

    The DataGridViewComboColumn contains combobox for a DataGridView on your .NET form. The Combo column is not just a dropdown combobox, which appears when a DataGridView cell becomes the current cell. The .Net DataGridView Combo Column control has the following attractive features:

    This DataGridView Combo column is not just a dropdown combobox, which appears when a DataGridView cell becomes the current cell. This DataGridView Combo Column gives you ability to instantly update dropdown values with a really simple and friendly user interface. When you click the combo button a dropdown multiple columns grid of its list values will be shown below the combo. You can update values,and insert and delete rows into the dictionary DataGridView.

    You can set its DataSource, DisplayMember, and ValueMember to bind the Combo to a foreign table

    The control gives an ability to get a nesting combo box that filters values from a related child table. In a dictionary grid, you can view and edit related data in a child table. In your database a Master table has a one-to-many relationship with a Child table; so for each row of the Master table in Dictionary grid, you or your customer can view and edit the related


    rows of the Child table in a dictionary grid. For this case we have to define two string arrays with key fields' names MasterFields and ChildFields. To get the filtering we must identify Master and Child tables' key fields. These fields’ names in both arrays must have the same order sequence.

    Syntax
    DataGridViewComboColumn()

    XML Converter is available!
    More about XML Converter
    Download XML Converter
    Order XML Converter

    Some Properties

    box - Combobox object in selected cell. Gets the hosted box control that is an overridden instance of the ComboBox control.

    box.DataSource - a source for DataGridView values list as System.Data.DataTable

    box.DisplayMember - field to display in combo as String (name of table column)

    box.ValueMember - field with values, which binds to combo as String (name of table column). Specify the contents of the ValueMember property in cases where you bind data.

    box.DisplayMode - Identifies what kind of data you would like to see in whole DataGridView customized column, as DataGridViewColumns.DisplayModes. You may choose the following values:
    ShowDisplayMember - default. DisplayMember will be shown in whole column
    ShowValueMember - ValueMember will be shown in whole column
    ShowValueMember_and_DisplayMember - ValueMember + DisplayMember will be shown together in a column

    box.allDictionaryColumns - The property identifies how many columns you need to see in the called Dictionary grid, as DataGridViewColumns.FieldsDisplayType(default is DisplayMember_ValueMember_only)
    You may set the following values:
    DisplayMember_ValueMember_only - default. DisplayMember and/or ValueMember fields will be shown in your drop-down Dictionary grid.
    allFields - all related child table's fields will be shown in your drop-down Dictionary grid.
    allFields_ExceptRelationKey - all related child table's fields will be shown in your Dictionary grid except relation key fields.

    Also you can leave the allDictionaryColumns parameter (define it as null in C# and C++ code) and specify your own columns for the Dictionary DataGridView. Please see our samples to learn how to do that.

    Example  
    The following example creates a DataGridViewComboColumn object and adds it to the DataGridView layout.  
    VB .NET   
     
    With DataGridView1  
     
    ' Set DataGridView Combo Column for CarID field   
    Dim ColumnCar As New DataGridViewComboColumn  
    ' DataGridView Combo ValueMember field has name "CarID"  
    ' DataGridView Combo DisplayMember field has name "Car"  
    With ColumnCar  
        .DataPropertyName = "CarID"  
        .HeaderText = "Car Name"  
        .Width = 80  
        ' Bind ColumnCar to Cars table  
        .box.DataSource = ds.Tables("Cars")  
        .box.ValueMember = "CarID"  
        .box.DisplayMember = "Car"  
    End With  
    .Columns.Add(ColumnCar)  
     
    End With  
     
    C#  
    // Set DataGridView Combo Column for CarID field   
    DataGridViewComboColumn ColumnCar = new DataGridViewComboColumn();  
    // DataGridView Combo ValueMember field name is "CarID"  
    // DataGridView Combo DisplayMember field name is "Car"  
    ColumnCar.DataPropertyName = "CarID";  
    ColumnCar.HeaderText = "Car Name";  
    ColumnCar.Width = 80;  
    // Bind ColumnCar to Cars table  
    ColumnCar.box.DataSource = ds.Tables["Cars"];  
    ColumnCar.box.ValueMember = "CarID";  
    ColumnCar.box.DisplayMember = "Car";  
    // Add ColumnCar onto DataGridView layout  
    DataGridView1.Columns.Add(ColumnCar);  
    Please read the DataGridViewColumns assembly documentation to learn more about the DataGridViewComboColumn class provided events and class members.

    DataGridView TimeUpDown Column

    The RustemSoft DataGridViewTimeUpDownColumn represents a DataGridView column up-down control that displays Time values. It allows you to show a TimeUpDown control in a DataGridView cell.
    The TimeUpDown column contains a single Time value that can be incremented or decremented by clicking the up or down buttons of the control in a DataGridView cell. You may also enter in a value.
    The Time display may be formatted by setting the TimeFormat property that can have the following values:
    HHMM12
    HHMMSS12
    HHMM24
    HHMMSS24

    Syntax
    DataGridViewTimeUpDownColumn()

    Please read the DataGridViewColumns assembly documentation to learn more about the DataGridViewTimeUpDownColumn class provided events and class members.

    DataGridView Memo column

    The RustemSoft DataGridViewMemoColumn gives you a useful Memo Field control, which presents an edit window when user selects a cell of the DataGridView Memo Column on .NET DataGridView. This provides a pop-up memo field editor that you can call from your code at any time to let users edit the text in a memo field.

    This Memo field editor provides more flexibility by updating the memo field to be used in a .NET DataGridView column.

    The DataGridView Memo Column Memo field editor is useful for showing short document contents, like memos and emails.
    When using the DataGridView Memo Column editor you are automatically provided with all general features, which any typical, contemporary word processor has.

    You may send the Memo box content via email by clicking a special button within the memo box control interface.

    The DataGridViewMemoColumn includes a cancel feature. If you click OK the changes made are sent back to the table. When you click on the 'x'-button in the upper right corner or Cancel button your changes will not be stored. You may hide the Cancel button by using the showCancelButton property.

    Syntax
    DataGridViewMemoColumn()
    Some Properties
    box.Caption - a title of Memo editor window as String


    Example  
    The following example creates a DataGridViewMemoColumn and adds it into the DataGridView layout.  
    VB .NET   
    ' Set DataGridView Memo Column for Remark field  
    Dim ColumnMemo As New DataGridViewMemoColumn  
    With ColumnMemo  
        .DataPropertyName = "Remark"  
        .HeaderText = "Remark"  
        .Width = 70  
        .box.showCancelButton = False  
        .box.Caption = "Edit Memo field text"  
    End With  
    DataGridView1.Columns.Add(ColumnMemo)  
     
    C#  
    // Set DataGridView Memo Column for Remark field  
    DataGridViewMemoColumn ColumnMemo = new DataGridViewMemoColumn();  
    ColumnMemo.DataPropertyName = "Remark";  
    ColumnMemo.HeaderText = "Remark";  
    ColumnMemo.Width = 70;  
    ColumnMemo.box.showCancelButton = false;  
    ColumnMemo.box.Caption = "Edit Memo field text";  
    // Add ColumnMemo onto DataGridView layout  
    DataGridView1.Columns.Add(ColumnMemo);  
    Please read the DataGridViewColumns assembly documentation to learn more about the DataGridViewMemoColumn class provided events and class members.

    DataGridView DateTimePicker column

    The DateTimePicker Column is used to allow the user to select a date and time, and to display that date/time in your DataGridView.

    You can limit the dates and times that can be selected by setting the MinDate and MaxDate properties.

    You can change the look of the calendar portion of the control by setting the CalendarForeColor, CalendarFont, CalendarTitleBackColor, CalendarTitleForeColor, CalendarTrailingForeColor, and CalendarMonthBackground properties.

    The Format property sets the DateTimePickerFormat of the control. The default date Format is DateTimePickerFormat.Long. If the Format property is set to DateTimePickerFormat.Custom, you can create your own format style by setting the CustomFormat property and building a custom format string. The custom format string can be a combination of custom field characters and other literal characters. For example, you can display the date as "June 01, 2001 - Friday" by setting the CustomFormat property to "MMMM dd, yyyy - dddd".

    box - one of the main properties of the DataGridViewDateTimePickerColumn class. The box is DateTimePicker object in selected cell. It gets the hosted box control that is an overridden instance of the DateTimePicker control.

    Syntax
    DataGridViewDateTimePicker()


    Example  
    The following example creates a DataGridViewDateTimePicker object and adds it into the DataGridView layout.  
    VB .NET   
    ' Define ColumnPicker DateTime Picker Column with WithEvents keyword  
    Private WithEvents ColumnPicker As New DataGridViewDateTimePickerColumn  
     
    .........  
     
    ' Set DataGridView DateTimePicker Column for DateFirst field  
    ' The ColumnPicker DateTime Picker Column is defined above with WithEvents keyword to make  
    ' the column object visible in the whole class scope. The WithEvents keyword indicates  
    ' that a declared object variable refers to  a class  instance that  can raise events.  
    With ColumnPicker  
        .DataPropertyName = "DateFirst"  
        .HeaderText = "Date"  
        .Width = 85  
        ' Identify whole column back and fore colors  
        .CellTemplate.Style.BackColor = Color.LightPink  
        .CellTemplate.Style.ForeColor = Color.DarkBlue  
        ' Identify column selected calendar back and foreground color  
        .box.CalendarForeColor = Color.Red  
        .box.CalendarMonthBackground = Color.PowderBlue  
        ' Identify whole column DateTime format to display in each inactive column  
        .DateTimeDisplayFormat = DateTimeStencils.MMDDYY  
     
        '' for European people (you can see the date as "31.12.2008"):  
        'System.Threading.Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo("de-DE")  
        '.DateTimeEditFormat = DateTimePickerFormat.Custom  
        '.box.CustomFormat = "dd.MM.yy"  
        '.DateTimeDisplayFormat = Stencils.DDMMYY  
        '.DelimiterChar = "."  
     
        '' !!! To empty a DateTimePickerColumn cell just push Delete or  
        ''     click the right mouse button when the cell is selected !!!  
    End With  
    .Columns.Add(ColumnPicker)  
     
    C#  
    // Define ColumnPicker DateTime Picker Column  
    internal DataGridViewDateTimePickerColumn ColumnPicker = new DataGridViewDateTimePickerColumn();  
     
    .........  
     
    // Set DataGridView DateTimePicker Column for DateFirst field  
    // The ColumnPicker Column is defined above to make the column object visible in the whole   
    // class scope. The declared object variable refers to a class instance that can raise events.  
    ColumnPicker.DataPropertyName = "DateFirst";  
    ColumnPicker.HeaderText = "Date";  
    ColumnPicker.Width = 85;  
    // Identify whole column back and fore colors  
    ColumnPicker.CellTemplate.Style.BackColor = Color.LightPink;  
    ColumnPicker.CellTemplate.Style.ForeColor = Color.DarkBlue;  
    // Identify column selected calendar back and foreground color  
    ColumnPicker.box.CalendarForeColor = Color.Red;  
    ColumnPicker.box.CalendarMonthBackground = Color.PowderBlue;  
    // Identify whole column DateTime format to display in each inactive column  
    ColumnPicker.DateTimeDisplayFormat = DateTimeStencils.MMDDYY;  
     
    // for European people (you can see the date as "31.12.2008"):  
    /*   
    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE");  
    ColumnPicker.DateTimeEditFormat = DateTimePickerFormat.Custom;  
    ColumnPicker.box.CustomFormat = "dd.MM.yy";  
    ColumnPicker.DateTimeDisplayFormat = DateTimeStencils.DDMMYY;  
    ColumnPicker.DelimiterChar = ".";  
    */  
     
    // !!! To empty a DateTimePickerColumn cell just push Delete or  
    //     click the right mouse button when the cell is selected !!!  
     
    // Add ColumnPicker column LeaveEvent Handler  
    ColumnPicker.Leave += new DataGridViewDateTimePickerColumn.LeaveEventHandler(ColumnPicker_Leave);  
    // Add ColumnPicker onto DataGridView layout  
    DataGridView1.Columns.Add(ColumnPicker);  
    Please read the DataGridViewColumns assembly documentation to learn more about the DataGridViewDateTimePicker class provided events and class members.

    DataGridView Calculator Column

    Calculator DataGridView Column control provides a calculator environment with Real and Complex arithmetic support. This formatted intelligent Calculator control works as the Numeric box control plus a simple, easy-to-use, friendy Calculator interface that pop-ups when Calculator button is clicked. Also it can mask the numbers, digits, decimal and checks the validation, and automatically set the delimiter location. You may input any number. If there is a numeric scale defined with the field, it is used to format the display and the input.

    Note By default the .NET Calculator Column follows the formatting of the original datatable's column. If you define specific parameters (MaxLength, DecimalLength,...) for the box object it will accept them. However if the original DataTable's column could not accept your defined parameters it will ignore your settings. For example, the datatype for an original numeric datatable's field is Integer and you give to the DecimalLength parameter some not zero value. For this case the control will not allow your users to insert decimal values. Please choose appropriate datatypes and column settings.

    Syntax

    DataGridViewCalculatorColumn()
    Some Properties

    box.SpecialFunctionsVisible - as Boolean. Define if Special Functions buttons are Visible in Calculator. Default is False.

    box.CloseByEqualButton - as Boolean. Close Calculator Window by clicking Equal '=' Button. Default is False.

    box.IntegerOnly - as Boolean. Default is False.

    box.PositiveOnly - as Boolean. Default is False.

    box.DefaultValue - any numeric value. Default is empty numeric (null/Nothing).

    box.MinValue - any floating-point value range minimum of the inserted value. Default is empty numeric (null/Nothing).

    box.MaxValue - any floating-point value range maximum of the inserted value. Default is empty numeric (null/Nothing).

    box.DecimalLength - as integer, specifies a fixed decimal length. Default is empty numeric (null/Nothing).


    DataGridView DateTime Column

    You have a DataGridView with a DateTime field that displays the date/time as "2/20/2008 7:00:00 PM". You would like to display only the time in the following format "7:00 PM". You would like to insert a new time in the column or update current time value only. Let us suppose that you are European and would like to see in date field something like "20.02.2008". The DataGridViewDateTimeColumn can help you design the concept that will resolve your needs.
    The DateTime Column is used to allow the user to insert formatted date and time, and to display that date/time in your DataGridView.

    Syntax
    DataGridViewDateTimeColumn()

    Some Properties

    box - DateTime textbox object in selected cell. Gets the hosted box control that is an overridden instance of the DateTime textbox control.

    box.DateTimeFormat - Various formats may be set. You may use a date/time format (like MMDDYY, MMDDYYYY, DDMMYY, DDMMYYYY, YYYYMMDD, HHMM12, HHMMSS12, HHMM24, HHMMSS24) to enable the date/time inserting and updating. Default is MMDDYYYY.

    box.DefaultValue - any DateTime value. For example, you can set the DefaultValue to today's date. Default is empty DateTime (null/Nothing).

    box.DelimiterChar - a delimiter between date/time fractions (between days and month or hours and minutes). Default is "/".


    Example  
    The following example creates a DataGridViewDateTimeColumn and adds it into the DataGridView layout.  
    VB .NET   
    ' Set datagrid DateTime Column for TimeFirst field  
    Dim ColumnTime As New DataGridViewDateTimeColumn  
    With ColumnTime  
        .DataPropertyName = "TimeFirst"  
        .HeaderText = "Time"  
        .Width = 60  
        ' Identify selected cell's DateTime format to edit  
        .box.DateTimeFormat = DateTimeStencils.HHMM12  
        ' Identify whole column DateTime format to display in each inactive column  
        .DateTimeDisplayFormat = DateTimeStencils.HHMM12  
        ' Specify Delimiter Character for the field  
        .box.DelimiterChar = "."  
        .box.DefaultValue = New DateTime(2000, 5, 26, 11, 11, 11)  
        ' Identify column selected cell back and foreground color  
        .box.BackColor = Color.LightGray  
        .box.ForeColor = Color.DarkRed  
        ' Define cell warning color  
        .box.ProblemColor = Color.LightPink  
        ' Identify whole column back and fore colors  
        .CellTemplate.Style.BackColor = Color.Ivory  
        .CellTemplate.Style.ForeColor = Color.DarkBlue  
        ' Define cell border style  
        .box.BorderStyle = BorderStyle.None  
        ' You may turn error messages off  
        'ColumnTime.box.ErrMessageVisible = False  
    End With  
    DataGridView1.Columns.Add(ColumnTime)  
     
    C#  
    // Set datagrid DateTime Column for TimeFirst field  
    DataGridViewDateTimeColumn ColumnTime = new DataGridViewDateTimeColumn();  
    ColumnTime.DataPropertyName = "TimeFirst";  
    ColumnTime.HeaderText = "Time";  
    ColumnTime.Width = 60;  
    // Identify selected cell's DateTime format to edit  
    ColumnTime.box.DateTimeFormat = DateTimeStencils.HHMM12;  
    // Identify whole column DateTime format to display in each inactive column  
    ColumnTime.DateTimeDisplayFormat = DateTimeStencils.HHMM12;  
    // Specify Delimiter Character for the field  
    ColumnTime.box.DelimiterChar = ".";  
    ColumnTime.box.DefaultValue = new DateTime(2000, 5, 26, 11, 11, 11).ToString();  
    // Identify column selected cell back and foreground color  
    ColumnTime.box.BackColor = Color.LightGray;  
    ColumnTime.box.ForeColor = Color.DarkRed;  
    // Define cell warning color  
    ColumnTime.box.ProblemColor = Color.LightPink;  
    // Identify whole column back and fore colors  
    ColumnTime.CellTemplate.Style.BackColor = Color.Ivory;  
    ColumnTime.CellTemplate.Style.ForeColor = Color.DarkBlue;  
    // Define cell border style  
    ColumnTime.box.BorderStyle = BorderStyle.None;  
    // You may turn error messages off  
    //ColumnTime.box.ErrMessageVisible = False;  
     
    // Add ColumnTime onto DataGridView layout  
    DataGridView1.Columns.Add(ColumnTime);  
    Please read the DataGridViewColumns assembly documentation to learn more about the DataGridViewDateTimeColumn class provided events and class members.

    DataGridView Numeric Column

    This formatted intelligent NumericColumn control can mask the numbers, digits, decimal and checks the validation, and automatically set the delimiter location. You may input any number. If there is a numeric scale defined with the field, it is used to format the display and the input.

    Note By default the numeric column follows the formatting of the original column. If you define specific parameters (MaxLength, DecimalLength,...) for the column it will accept them. However if the original DataTable's column could not accept your defined parameters it will ignore your settings. For example, the datatype for an original numeric datatable's field is Integer and you give to the DecimalLength parameter some not zero value. For this case the control will not allow your users to insert decimal values. Please choose appropriate datatypes and column settings.

    Syntax
    DataGridViewNumericColumn()

    Some Properties

    box - Numeric textbox object in selected cell. Gets the hosted box control that is an overridden instance of the Numeric textbox control.

    box.IntegerOnly - as Boolean. Default is False.

    box.PositiveOnly - as Boolean. Default is False.

    box.DefaultValue - any numeric value. Default is empty numeric (null/Nothing).

    box.MinValue - any floating-point value range minimum of the inserted value. Default is empty numeric (null/Nothing).

    box.MaxValue - any floating-point value range maximum of the inserted value. Default is empty numeric (null/Nothing).

    box.MaxLength - as integer, specifies a fixed length of whole input area. Default is empty numeric (null/Nothing).

    box.DecimalLength - as integer, specifies a fixed decimal length. Default is empty numeric (null/Nothing).


    Example  
    The following example creates a DataGridViewNumericColumn and adds it into the DataGridView layout.  
    VB .NET   
    ' Set datagrid Numeric Column for Price field  
    Dim NumericColumn As New DataGridViewNumericColumn  
    With NumericColumn  
        .DataPropertyName = "Price"  
        .HeaderText = "Price"  
        .Width = 60  
        ' Define some Numeric Box specific properties  
        .box.DecimalLength = 2  
        .box.MaxLength = 10  
        .box.PositiveOnly = True  
        ' Identify column selected cell back and foreground colors  
        .box.BackColor = Color.LightGray  
        .box.ForeColor = Color.DarkRed  
        ' Define cell warning color  
        .box.ProblemColor = Color.LightPink  
        ' Identify whole column back and fore colors  
        .CellTemplate.Style.BackColor = Color.WhiteSmoke  
        .CellTemplate.Style.ForeColor = Color.Brown  
        .CellTemplate.Style.Alignment = DataGridViewContentAlignment.MiddleRight  
        ' Define cell border style  
        .box.BorderStyle = BorderStyle.Fixed3D  
        ' Assign selected cell's font   
        .box.Font = New Font("Tahoma", 8, FontStyle.Bold)  
    End With  
    DataGridView1.Columns.Add(NumericColumn)  
     
    C#  
    // Set datagrid Numeric Column for Price field  
    DataGridViewNumericColumn NumericColumn = new DataGridViewNumericColumn();  
    NumericColumn.DataPropertyName = "Price";  
    NumericColumn.HeaderText = "Price";  
    NumericColumn.Width = 60;  
    // Identify column selected cell back and foreground colors  
    NumericColumn.box.BackColor = Color.LightGray;  
    NumericColumn.box.ForeColor = Color.DarkRed;  
    // Define cell warning color  
    NumericColumn.box.ProblemColor = Color.LightPink;  
    // Identify whole column back and foreground colors  
    NumericColumn.CellTemplate.Style.BackColor = Color.WhiteSmoke;  
    NumericColumn.CellTemplate.Style.ForeColor = Color.Brown;  
    NumericColumn.CellTemplate.Style.Alignment = DataGridViewContentAlignment.MiddleRight;  
    // Define cell border style  
    NumericColumn.box.BorderStyle = BorderStyle.Fixed3D;  
    // Assign selected cell's font  
    NumericColumn.box.Font = new Font("Tahoma", 8, FontStyle.Bold);  
    // Add NumericColumn onto DataGridView layout  
    DataGridView1.Columns.Add(NumericColumn);  
    Please read the DataGridViewColumns assembly documentation to learn more about the DataGridViewNumericColumn class provided events and class members.

    DataGridView Text Fractions Column

    This formatted intelligent TextFractionsColumn control can mask the text fractions. It gives you ability to manage the IP Address, SS#, Phone numbers, etc., and checks the validation, and automatically set the delimiter location.
    The TextFractionsColumn is useful in several situations. For example, this control will automatically format a telephone number so when a user enters a phone number like this:

    123-456-7890
    or
    1234567890

    it will automatically change the numbers in the column text updating box.

    Up to 5 text fractions can be defined. By setting the DelimiterChar property up a delimiter symbol for the control can be specified. You can define the overall length of each text fraction and what kind of characters can be inserted in the fraction (alphanumeric, numeric only, etc.).

    Syntax
    DataGridViewTextFractionsColumn()

    To identify each text fraction you must set values of ten properties where settings of the fractions are stored. The first five properties (I_stFractionFormat, II_ndFractionFormat, IIIrdFractionFormat, IVthFractionFormat, and VthFractionFormat) specifies what characters can be inserted into the fraction. It accepts the following values of FractionFormats enumeration:
    None - format is not assigned
    Numeric - numeric characters (0-9) are acceptable only
    Letters - letters (Aa-Zz) are acceptable only
    Alphanumeric - alphanumeric characters (Aa-Zz0-9) are acceptable only
    Punctuation - punctuation characters are acceptable only
    Spaces - spaces are acceptable only
    AnyCharacters - any characters are acceptable
    The second five box specific properties (I_stFractionLength, II_ndFractionLength, IIIrdFractionLength, IVthFractionLength, and VthFractionLength) specifies overall fraction's length.


    Example  
    The following example creates a DataGridViewTextFractionsColumn and adds it to the DataGridView layout.  
    VB .NET   
    ' Set DataGridView Text Fractions Column for Phone field  
    Dim MaskColumn As New DataGridViewFractionColumn  
    With MaskColumn  
        .DataPropertyName = "Phone"  
        .HeaderText = "Phone"  
        .Width = 100  
        ' selected cell has 3 fractions delimited by '-' char  
        ' Define 1st fraction's parameters  
        ' Numeric sym