Topic: Change combobox width with same cell width

Hi all,

Is it possible to get cell width and resize combobox with same size?

I use now

frmFifrsForm.TableGrid1.BestFitColumns(bfBoth);

For resizing cells and I want to make dynamic combobox that follows cell width

2 (edited by argonx 2020-09-17 10:13:15)

Re: Change combobox width with same cell width

Here is sample of what I need but when I make It OnColumnResize I get error

procedure Form1_TableGrid1_OnAfterSort (Sender: TObject; ACol: Integer);
begin
       form1.ComboBox1.Width := Form1.TableGrid1.Columns[0].Width;
       form1.ComboBox2.Width := Form1.TableGrid1.Columns[1].Width;
       form1.ComboBox2.Left := form1.ComboBox1.Left + form1.ComboBox1.Width + 1;
end;

Re: Change combobox width with same cell width

Hi Argonx,
Perhaps try it like this (see attached).
Derek.

Post's attachments

Attachment icon cbwidth.zip 336.94 kb, 240 downloads since 2020-09-18