Page 1 of 1

Columns Width

Posted: Fri 18 Dec 2009 13:08
by Milan Bacik
I have problem with width of columns in CRDBGrid. I have data in TOraQuery with fieldnames same as in database. CRDBGrid is set to stretch columns. I set Field->DisplayLabel to localized string. If the localized string and data in column are short and fieldname is long the column is wide to display fieldname. I know TCRDBGrid is not suportet anymore, but maybe the problem is in way I use it :)

Code: Select all

for (int i = StartPoz; i Fields->Fields[i]->DisplayLabel = GetLocalizedDisplayName(pSet->Fields->Fields[i]->FieldName);
  TColumn *pCol = DBGrid1->Columns->Add();
  pCol->FieldName = pSet->Fields->Fields[i]->FieldName;
}

Posted: Mon 21 Dec 2009 09:06
by Plash
You cannot control the width of columns when Stretch = True.