Skip to content

DataGridViewColumn

Radu Martin edited this page Apr 14, 2017 · 9 revisions

These extenders provide a lot of style settings.

The main method is:

SetStyles(int Width, 
          DataGridViewContentAlignment Alignment,
          string Format)

Width - width of the column Alignment - indicating the position of the cell content, default value is DataGridViewContentAlignment.MiddleLeft Format - format string applied to the textual content, default value is null

SetAutoSizeFillStyle(int MinimumWidth, float FillWeight = 100)

SetAutoSizeAllCellsStyle()

SetNumberStyle(int Width = 80)

SetDecimalStyle(int Width = 80)

SetMoneyStyle(int Width = 80)

SetPercentStyle(int Width = 80)

SetDateStyle(int Width = 110)

SetDateTimeStyle(int Width = 160)

SetDateTimeWithSecondsStyle(int Width = 160)

Execution can be combined, because these methods return the initial column:

column.SetDateTimeStyle().SetAutoSizeFillStyle(100);