Hi
i have a stringGrid :
StG_P8_2.ColCount := 103;
.
.
StG_P8_2.columns := 0;
.
.
StG_P8_2.Options:= StG_P8_2.Options + [goEditing];
.
.
StG_P8_2.Options:= StG_P8_2.Options + [goColSizing];
when i use this code :
StG_P8_2.Columns[1].Width:= 10;
i see Error ?
string grid in lcl has 2 different mechanisms to define and use columns
1) Col, ColCount, ColWidth. delphi compatible
2) the columns property more OO.
Someone made the unfortunate decision to have them separated you can use one or the other but not both.
here is a working sample on how to set the column width in your case.
StringGrid1.ColCount := 103;
StringGrid1.ColWidths[0] := 8;
StringGrid1.ColWidths[1] := 50;
StringGrid1.ColWidths[2] := 70;
StringGrid1.ColWidths[3] := 130;
StringGrid1.ColWidths[4] := 110;
StringGrid1.ColWidths[5] := 90;