Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing column size in a StringGrid component: How? 1

Status
Not open for further replies.

CHeighlund

Programmer
Jun 11, 2007
163
US
First off, let me say that I know about the cell parameters that the component has, but that changes the size of all of the cells in the grid. Is there some way to specifically change only the size of a single column? Most of the data I'm working with at the moment has an eight-character maximum size, but this doesn't apply to the first column (headings). Allowing enough size for readable headings means vast amounts of whitespace in the other cells, while trimming those means that the headings are getting cropped short. Is there any way that I can change the width of just that one column? It is a fixed column, if that changes the equation any.
 
if you're talking about a TStringGrid, try the ColWidths property where i is the column number.
Code:
[navy][i]// for automatic syntax highlighting see faq102-6487 
[/i][/navy][b]with[/b] StrGrid_Docket [b]do[/b]
  [b]begin[/b]
    FixedRows:= [purple]1[/purple];
    Cells[[purple]0[/purple], [purple]0[/purple]]:= [teal]'    Name'[/teal];
    Cells[[purple]1[/purple], [purple]0[/purple]]:= [teal]'    Case #'[/teal];
    Cells[[purple]2[/purple], [purple]0[/purple]]:= [teal]'  Status'[/teal];
    ColWidths[[purple]2[/purple]] := [purple]300[/purple];
  [b]end[/b];

Leslie

In an open world there's no need for windows and gates
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top