Recent

Author Topic: TStringGrid only auto-fill the first column width?  (Read 832 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

  • Hero Member
  • *****
  • Posts: 1080
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.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

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