TMSFNCDataGrid ColumnWidths resetted after DPIChange

I'm not sure if it is intended behavior or not. But as soon the Grid gets a DPIChange-Event the widths of all columns are resetted to the default width.

Expected: The actuall width of the columns is recalculated based on the previous and new DPI settings.

I searched the code but only find this code in TMSFNCDataGridRenderer:

    for I := 0 to Columns.Count - 1 do
      Columns[I].Width := Int(TTMSFNCUtils.MulDivSingle(Columns[I].Width, M, D));

So in theory the width should be correctly calculted, but it isn't. Am i missing something?

We'll investigate, are you using a connection with the database adapter?

No, the Grid is populated by "hand".

You can try it very easy:

  • Create new Project
  • Drop TMSFNCDataGrid onto the form
  • Enable ColumnSizing
  • Start the Program
  • Change the size of a column
  • Move the form to a Monitor with different DPI-Settings
  • ColumnSizes are resetted

Thanks for reporting, issue has been detected and fixed!

1 Like