Recent

Author Topic: TStringGrid only auto-fill the first column width?  (Read 202 times)

randohinn

  • New Member
  • *
  • Posts: 13
TStringGrid only auto-fill the first column width?
« on: July 14, 2020, 07:15:26 pm »
Hi

I'm at a loss of ideas here. Builidng a small thing to try out lazarus and would like to have a TStringGrid, where only the first column is auto expanded in width. Autofill does this for all columns.. So, keeping the other columns at their default widths. How could I achieve this?

dsiders

  • Sr. Member
  • ****
  • Posts: 376
Re: TStringGrid only auto-fill the first column width?
« Reply #1 on: July 14, 2020, 07:46:59 pm »
Hi

I'm at a loss of ideas here. Builidng a small thing to try out lazarus and would like to have a TStringGrid, where only the first column is auto expanded in width. Autofill does this for all columns.. So, keeping the other columns at their default widths. How could I achieve this?

Use the TStringGrid.Columns property to define which columns are affected when AutoFillColumns is set to True. Set the TGridColumn.SizePriority to 0 to prevent a column from being resized.
Lazarus 2.1 (SVN) / FPC 3.0.4 / FPC 3.2.0 / x86-win64 / Windows 8.1

randohinn

  • New Member
  • *
  • Posts: 13
Re: TStringGrid only auto-fill the first column width?
« Reply #2 on: July 14, 2020, 07:55:15 pm »
Perfect, thanks!

 

TinyPortal © 2005-2018