Skip to content

DataGridView

Radu Martin edited this page Apr 15, 2017 · 15 revisions

Column generation

Adding read-only text and check columns

AddTextColumn(string DataPropertyName, string HeaderText, string ToolTipText)
AddCheckColumn(string DataPropertyName, string HeaderText, string ToolTipText)

where DataPropertyName is a name of property or column name,
HeaderText is a text of colum header,
ToolTipText is a text for ToolTip on column header.

Visual styles

DataGridView can show the coloured DataRowState on his row Header

AddDataRowStateDrawingInRowHeaders(
      Color chgColor, 
      Color insColor, 
      bool IsGradient)

where chgColor is a colour for changed rows,
insColor is a colour for added rows,
and IsGradient is a flag fow drawing style.

For example:

dataGrid.AddDataRowStateDrawingInRowHeaders(
    Color.FromArgb(0x99, 0xFF, 0xCC, 0x33),
    Color.FromArgb(0x99, 0xFF, 0x66, 0x00), 
    true);

AddDataRowStateDrawingInRowHeaders

In addition, there are two versions of the AddDataRowStateDrawingInRowHeaders method without parameters which uses default colours.