[]
Adjusts the width of a column range to fit the data in a cell range.
public virtual void AutoSizeCols(int topRow, int leftCol, int bottomRow, int rightCol, int extraSpace, AutoSizeFlags flags)
Type | Name | Description |
---|---|---|
int | topRow | Top row in the range. |
int | leftCol | Left column in the range. |
int | bottomRow | Bottom row in the range. |
int | rightCol | Right column in the range. |
int | extraSpace | Amount of extra space, in pixels, to add to the column widths. |
AutoSizeFlags | flags | Flags that control auto-sizing options. |
By default, the AutoSizeCols(int, int, int, int, int, AutoSizeFlags) method measures every cell in each column, taking into account the cell contents and style.
If the grid has a large number of rows, you can improve performance by using the
topRow
and bottomRow
parameters to specify a row range.
You can include only a few hundred rows in the process, and add some extra spacing for safety.
Adjusts the width of all columns to fit the data.
public virtual void AutoSizeCols()
Adjusts the width of columns in a range to fit the data.
public virtual void AutoSizeCols(int leftCol, int rightCol, int extraSpace)
Type | Name | Description |
---|---|---|
int | leftCol | Left column in the range. |
int | rightCol | Right column in the range. |
int | extraSpace | Amount of extra space, in pixels, to add to the column widths. |
Adjusts the width of all columns fit the data.
public virtual void AutoSizeCols(int extraSpace)
Type | Name | Description |
---|---|---|
int | extraSpace | Amount of extra space, in pixels, to add to the column widths. |
Automatically size grid columns to fit the largest entry.
protected virtual void AutoSizeCols(Graphics g, int row1, int col1, int row2, int col2, int extra, AutoSizeFlags flags)
Type | Name | Description |
---|---|---|
Graphics | g | Graphics object used to measure the cell contents. |
int | row1 | Index of the first row to be measured. |
int | col1 | Index of the first column to be measured. |
int | row2 | Index of the last row to be measured. |
int | col2 | Index of the first column to be measured. |
int | extra | Extra space, in twips, to add to the largest entry. |
AutoSizeFlags | flags | AutoSizeFlags value that specifies auto-sizing behavior. |
This method is for internal use. It allows inherited classes to customize the grid appearance.