CExtGridWnd::BestFitColumn

Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

Makes the column width wide enough to fit the longest cell content and returns true if successful or false otherwise.

virtualbool BestFitColumn(
   LONG nColNo,
   INT nColType = 0,
   bool bDoBestFitByOuterCells = true,
   bool bDoBestFitByInnerCells = true,
   bool bDoBestFitByVisibleRowRangeOnly = true,
   bool bRedraw = true
);

Parameters

nColNo
Column index.
nColType
Type of the column (0 - inner column, -1 - outer column on left, 1 - outer column on right).
bDoBestFitByOuterCells
Indicates the content of outer grid cells should be measured if bDoBestFitByOuterCells is true; ignored otherwise.
bDoBestFitByInnerCells
Indicates the content of inner grid cells should be measured if bDoBestFitByInnerCells is true; ignored otherwise.
bDoBestFitByVisibleRowRangeOnly
Indicates the content of inner grid cells that is visible at the moment should be measured only if bDoBestFitByVisibleRowRangeOnly is true; otherwise, the content of all inner cells in this column (if bDoBestFitByInnerCells is true) will be measured.
bRedraw
Indicates that the grid control is to be immediately redrawn if bRedraw is true.

See Also

CExtGridWnd Overview | Class Members | Hierarchy Chart