[]
        
(Showing Draft Content)

C1.Win.C1FlexGrid.C1FlexGridBase.AutoSizeCols

AutoSizeCols Method

AutoSizeCols(int, int, int, int, int, AutoSizeFlags)

Adjusts the width of a column range to fit the data in a cell range.

Declaration
public virtual void AutoSizeCols(int topRow, int leftCol, int bottomRow, int rightCol, int extraSpace, AutoSizeFlags flags)
Parameters
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.

Remarks

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.

AutoSizeCols()

Adjusts the width of all columns to fit the data.

Declaration
public virtual void AutoSizeCols()

AutoSizeCols(int, int, int)

Adjusts the width of columns in a range to fit the data.

Declaration
public virtual void AutoSizeCols(int leftCol, int rightCol, int extraSpace)
Parameters
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.

AutoSizeCols(int)

Adjusts the width of all columns fit the data.

Declaration
public virtual void AutoSizeCols(int extraSpace)
Parameters
Type Name Description
int extraSpace

Amount of extra space, in pixels, to add to the column widths.

AutoSizeCols(Graphics, int, int, int, int, int, AutoSizeFlags)

Automatically size grid columns to fit the largest entry.

Declaration
protected virtual void AutoSizeCols(Graphics g, int row1, int col1, int row2, int col2, int extra, AutoSizeFlags flags)
Parameters
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.

Remarks

This method is for internal use. It allows inherited classes to customize the grid appearance.