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.

Order the DataGridViewColumns assembly

Hot Queston

Read the DataGridViewColumns assembly documentation

Excellent work, guys! Thanks a lot!
Ryan J. Birnesser
Systems Software Designer/Programmer
Pioneer Pole Buildings, Inc.
Schuylkill Haven, PA

These Column classes are chock full of functionality that you wont find in the standard Microsoft .NET DataGridView Columns, that make it easy to build professional and forcing user interfaces.

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.

ASP DataGridColumns .NET assembly
More about ASPDataGridColumns.dll
Download ASPDataGridColumns.dll
Order ASPDataGridColumns.dll

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

The .NET Framework includes six types of DataGridView column classes by default: DataGridViewButtonColumn, DataGridViewCheckBoxColumn, DataGridViewComboboxColumn, DataGridViewImageColumn, DataGridViewTextBoxColumn, and DataGridViewLinkColumn classes. 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 Calculator Column
  • DataGridView Label 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 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

    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 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.

    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

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

    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 "/".

    Please read the DataGridViewColumns assembly documentation to learn more about the DataGridViewDateTimeColumn 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 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.

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

    DataGridView Label Column

    The control creates a column of Labels mapped to DataColumn of type String.

    The Rustemsoft DataGridViewLabelColumn provides you with a read-only cell. It gives you ability to set all column desired colors and raises an event when the cell is clicked allowing you to interact to the event in your code.

    The DataGridViewLabelColumn raises a Cell event when the user clicks on a cell you can react to this event in your code.

    Syntax
    DataGridViewLabelColumn()

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

    Example  
    The following example creates a DataGridViewLabelColumn and adds it to the DataGridView layout.  
    VB .NET   
    ' Define ColumnLabel Label Column with WithEvents keyword  
    Private WithEvents ColumnLabel As New DataGridViewLabelColumn  
    ' Set DataGridView Label Column for ID field  
    ' The ColumnLabel Label 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 ColumnLabel  
        .DataPropertyName = "ID"  
        .HeaderText = "ID"  
        .Width = 25  
        ' Identify LabelColumn selected cell backcolor  
        .box.BackColor = Color.LightSalmon  
        ' Identify whole LabelColumn back and fore colors  
        .CellTemplate.Style.BackColor = Color.Lavender  
        .CellTemplate.Style.ForeColor = Color.DarkBlue  
        .box.BorderStyle = BorderStyle.FixedSingle  
        ' Assign Label Font   
        .box.Font = New Font("Tahoma", 8, FontStyle.Bold)  
    End With  
    DataGridView1.Columns.Add(ColumnLabel)  
     
    C#  
    // Define ColumnLabel Label Column  
    internal DataGridViewLabelColumn ColumnLabel = new DataGridViewLabelColumn();  
    // Set DataGridView Label Column for ID field  
    // The ColumnLabel Label 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.  
    ColumnLabel.DataPropertyName = "ID";  
    ColumnLabel.HeaderText = "ID";  
    ColumnLabel.Width = 25;  
    // Identify LabelColumn selected cell backcolor  
    ColumnLabel.box.BackColor = Color.LightSalmon;  
    // Identify whole LabelColumn back and fore colors  
    ColumnLabel.CellTemplate.Style.BackColor = Color.Lavender;  
    ColumnLabel.CellTemplate.Style.ForeColor = Color.DarkBlue;  
    ColumnLabel.box.BorderStyle = BorderStyle.FixedSingle;  
    // Assign Label Font  
    ColumnLabel.box.Font = new Font("Tahoma", 8, FontStyle.Bold);  
    // Add ColumnLabel ClickEvent Handler  
    ColumnLabel.Click += new DataGridViewLabelColumn.ClickEventHandler(this.ColumnLabel_Click);  
    // Add ColumnLabel onto DataGridView layout  
    DataGridView1.Columns.Add(ColumnLabel);  

    DataGridView DomainUpDown Column

    The Rustemsoft DataGridViewDomainUpDownColumn represents a DataGridView column up-down control that displays string values. It allows you to show a DomainUpDown control in a DataGridView cell.
    The control displays in a DataGridView cell a single string value that is selected from a string collection by clicking the up or down buttons of the control. The user can also enter text in the control if the string typed in matched an item in the collection to be accepted.

    To create a collection of objects to display in the DomainUpDown control, you can add or remove the items individually by using the Add and Remove methods.
    Besides that you can identify a DataSource parameter for the control. The DataSource is a source for DataGridView DomainUpDown column values list as System.Data.DataTable. By defining DisplayMember parameter you can specify a field to display in DomainUpDown column as Integer (index of column) or as String (name of table column).
    The object collection may be sorted alphabetically by setting the Sorted property to true.

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

    Syntax
    DataGridViewDomainUpDownColumn()

    Some Properties
    DataSource - a source for a DataGridView DomainUpDown column values list as System.Data.DataTable

    DisplayMember - field to display in a column cell as String (name of a DataTable column)

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

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

    DataGridView NumericUpDown Column

    The Rustemsoft DataGridViewNumericUpDownColumn represents a DataGridView column up-down control that displays numeric values. It allows you to show a NumericUpDown control in a DataGridView cell.
    The NumericUpDown column contains a single numeric 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 numeric display may be formatted by setting the DecimalPlaces, Hexadecimal, or ThousandsSeparator properties.

    Syntax
    DataGridViewNumericUpDownColumn()


    Example  
    The following example creates a DataGridViewNumericUpDownColumn and adds it to the DataGridView layout.  
    VB .NET   
    ' Set DataGridView NumericUpDown Column for Percent field  
    Dim UpDnColumn As New DataGridViewNumericUpDownColumn  
    With UpDnColumn  
        .DataPropertyName = "Percent"  
        .HeaderText = "%%"  
        .Width = 50  
       ' Set the Minimum, Maximum, and initial Value.  
        .box.Value = 5  
        .box.Maximum = 2500  
        .box.Minimum = - 100  
    End With  
    .Columns.Add(UpDnColumn)  
     
    C#  
    // Set DataGridView NumericUpDown Column for Percent field  
    DataGridViewNumericUpDownColumn UpDnColumn = new DataGridViewNumericUpDownColumn();  
    UpDnColumn.DataPropertyName = "Percent";  
    UpDnColumn.HeaderText = "%%";  
    UpDnColumn.Width = 50;  
    // Set the Minimum, Maximum, and initial Value.  
    UpDnColumn.box.Value = 5;  
    UpDnColumn.box.Maximum = 2500;  
    UpDnColumn.box.Minimum = - 100;  
    // Add UpDnColumn onto DataGridView layout  
    DataGridView1.Columns.Add(UpDnColumn);  
    Please read the DataGridViewColumns assembly documentation to learn more about the DataGridViewNumericUpDownColumn class provided events and class members.

    DataGridView Picture Column

    The Rustemsoft DataGridViewPictureColumn represents a DataGridView picture column for displaying an image.

    Usually the Picture column is used to display graphics from a bitmap(BMP), icon, metafile, GIF, JPEG or PNG file.
    The Picture is displayed by default without any borders in DataGridView cell. You can provide a standard or 3D border using the BorderStyle property.
    When you click the control the picture raises an event that you can grab in your code.

    Syntax
    DataGridViewPictureColumn()

    Please read the DataGridViewColumns assembly documentation to learn more about the DataGridViewPictureColumn 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 Masked TextBox Column

    The Rustemsoft DataGridView MaskedTextBox Column control provides restricted data input as well as formatted data output. This control supplies visual cues about the type of data being entered or displayed. It uses a mask to distinguish between appropriate and improper user input.
    When the DataGridView MaskedTextBox Column cell is selected at run time, it represents the mask as a series of prompt characters and optional literal characters.

    Each editable mask position, representing a required or optional input, is shown with a single prompt char. For example, the number sign # is often used as a placeholder for a numeric character input. You can use the PromptChar property to specify a custom prompt character. The HidePromptOnLeave property determines if the user sees the prompt characters when the DataGridView MaskedTextBox Column cell loses input focus.

    Syntax
    DataGridViewMaskedTextBoxColumn()


    Example  
    The following example creates a DataGridViewMaskedTextBoxColumn and adds it into the DataGridView layout.  
    VB .NET   
    ' Set DataGridView MaskedTextBox Column for ZipCode field  
    Dim ColumnMaskedTextBox As New DataGridViewMaskedTextBoxColumn  
    With ColumnMaskedTextBox  
        .DataPropertyName = "ZipCode"  
        .HeaderText = "Zip Code"  
        .Width = 100  
        ' Define Mask  
        .box.Mask = "99999-9999"  
        ' Define Mask Format  
        .box.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals  
     
        ' Identify column selected cell back and foreground colors  
        .box.BackColor = Color.Lavender  
        .box.ForeColor = Color.DarkOrchid  
        ' Identify whole column back and foreground colors  
        .CellTemplate.Style.BackColor = Color.WhiteSmoke  
        .CellTemplate.Style.ForeColor = Color.Brown  
        .CellTemplate.Style.Alignment = DataGridViewContentAlignment.MiddleRight  
        ' Define selected cell border style  
        .box.BorderStyle = BorderStyle.Fixed3D  
        ' Define selected cell's font  
        .box.Font = New Font("Tahoma", 8, FontStyle.Bold)  
    End With  
    DataGridView1.Columns.Add(ColumnMaskedTextBox)  
     
    C#  
    // Set DataGridView MaskedTextBox Column for ZipCode field  
    DataGridViewMaskedTextBoxColumn ColumnMaskedTextBox = new DataGridViewMaskedTextBoxColumn();  
    ColumnMaskedTextBox.DataPropertyName = "ZipCode";  
    ColumnMaskedTextBox.HeaderText = "Zip Code";  
    ColumnMaskedTextBox.Width = 100;  
    // Define Mask  
    ColumnMaskedTextBox.box.Mask = "99999-9999";  
    // Define Mask Format  
    ColumnMaskedTextBox.box.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;  
    // Identify column selected cell back and foreground colors  
    ColumnMaskedTextBox.box.BackColor = Color.Lavender;  
    ColumnMaskedTextBox.box.ForeColor = Color.DarkOrchid;  
    // Identify whole column back and foreground colors  
    ColumnMaskedTextBox.CellTemplate.Style.BackColor = Color.WhiteSmoke;  
    ColumnMaskedTextBox.CellTemplate.Style.ForeColor = Color.Brown;  
    ColumnMaskedTextBox.CellTemplate.Style.Alignment = DataGridViewContentAlignment.MiddleRight;  
    // Define selected cell border style  
    ColumnMaskedTextBox.box.BorderStyle = BorderStyle.Fixed3D;  
    // Define selected cell's font  
    ColumnMaskedTextBox.box.Font = new Font("Tahoma", 8, FontStyle.Bold);  
    // Add ColumnMaskedTextBox onto DataGridView layout  
    DataGridView1.Columns.Add(ColumnMaskedTextBox);  
    Please read the DataGridViewColumns assembly documentation to learn more about the DataGridViewPictureColumn class provided events and class members.

    DataGridView Print Class

    Obviously the DataGridViewPrint class is not a DataGridView column control. The service class is intended to help you to create a print output based on your DataGridView content. The class has been included into assembly since it is build for .NET WinForms DataGridView control and very helpful for your .NET DataGridView design. It will help you to implement an application with a print preview and a print support.
    The DataGridViewPrint class is used by the Print dialog and Print Preview dialog (on your .NET form) to draw the DataGridView object content that should be printed. An object of the class is used for a .NET PrintDocument object.

    Syntax
    DataGridViewPrint(PrintDocument1, DataGridView1, bBlackWhite)

    PrintDocument1 - System.Drawing.Printing.PrintDocument reusable object that sends output to a printer
    DataGridView1 - System.Windows.Forms.DataGridView object that content you are going to print
    bBlackWhite - boolean parameter that defines if you like to use "Black and White" printing mode or you would like to send to printer the real coloring that your DataGridView control has currently on your form.

    Please read the DataGridViewColumns assembly documentation to learn more about the DataGridViewPrint class provided members.

    Add a Reference for Visual Studio .NET project

    Suppose you are building a project using Visual Studio.NET, and you decide that you want to start consuming Rustemsoft DataGridViewColumns .NET assembly for a .NET DataGridView control on your Windows form. The first step that you will generally take is, you will add a reference to the DataGridViewColumns .NET assembly, which is residing in some directory on your PC hard drive. Visual Studio .NET will then add a new item under Solution Explorer called 'References', and it will create a row node underneath it called DataGridViewColumns.
    In order to add the reference to DataGridViewColumns .NET assembly please follow the steps:

    Select Project from the menu bar
    Choose Add Reference from the drop down menu
    Click on the Browse button
    Browse to and choose DataGridViewColumnsTrial.dll

    The Reference to a .NET Rustemsoft namespace is a requirement and must be added to a project before the objects in the Rustemsoft namespace can be used. The VB .NET Imports statement (or C# using statement) is not a requirement and is simply a coding convenience that allows shorter names to be used. You can add the statement to your code:

    VB .NET
    Imports Rustemsoft.DataGridViewColumns

    C#
    using Rustemsoft.DataGridViewColumns;

    C++
    #using <DataGridViewColumnsTrial.dll>
    using namespace Rustemsoft;

    Download the DataGridViewColumns .NET assembly code samples for VB.NET and C# that show how you can use the Rustemsoft DataGridView Columns in Windows Forms .NET DataGridView.


    Note DataGridView Windows Forms control can accept a DataSet for its DataSource property and automatically display the contents of ONLY one of the DataTables in the DataSet unlike .NET DataGrid control can show a hierarchical view of Data Tables. This is a big disadvantage of DataGridView .NET Windows Forms control.






    Copyright © 2001-2014 Rustemsoft LLC All Rights Reserved.