FNCGrid Column Widths Problem when moving columns

Hi,

I noticed that when reordering columns, if the column is moved at least two places from its original location, the ColumnWidths are not applied correctly, and column widths of other columns are also affected. Is there a way i can move columns and have the column widths adjust accordingly? I'm on FNC UI Pack 3.2.2.0 if this helps. My application is on Delphi XE7 but also tried this on Delphi Tokyo and the problem still exists.

Thank you!

PS. i searched the forums and found a similar issue reported but on TMSFMXGrid. The post was Nov'19, is there an update on the TMSGrids i might have missed that fixes this issue?

We have tested here with the latest version and are not able to reproduce the issue. We dropped a grid on the form, and used:

TMSFNCGrid1.ColumnWidths[3] := 200;
TMSFNCGrid1.LinearFill;
TMSFNCGrid1.Options.Mouse.ColumnDragging := True;

This allowed us to drag & drop columns, preserving the width of the columns.

Can you provide more info and a test sample or code snippet?

Hi,

(The inquiry above is actually mine, posted via a colleague's account)

What I did was:

  1. Add TMSFNCGrid to Form
  2. the following are set via designer (none set at runtime):
  • ColumnCount to 10
  • Set Column widths to increment by 10 ([0].Width is 10, [1].Width is 20...etc)
  • made sure the width of the grid fits all the columns without scrolling horizontally (just so i can visually see if any column decreased/increased width unintentionally. )
  • Set Options->Mouse->ColumnDragging to true
  • Added a memo where i can see ColumnStatesToString values
  1. Run the app, dragged Column[1] to Column[7]

Original ColumnStateToString was 10#10,20,30,40,50,60,70,80,90,100#0,1,2,3,4,5,6,7,8,9#1,1,1,1,1,1,1,1,1,1
ColumnStateToString after dragging was 10#10,20,40,50,60,70,80,80,90,100#0,2,3,4,5,6,7,1,8,9#1,1,1,1,1,1,1,1,1,1

Based on the ColumnStateToString, there are now 2 columns that have width 80, and no width 30. Also, the grid now has a horizontal scrollbar despite me not resizing any of the columns, i just repositioned column[1] to column[7]. also, the appearance of the grid doesn't seem to match the resulting ColumnStateToString in terms of column widths.

Please see attached sample project (done on Vcl but problem exists in firemonkey too)
FNCGrid ColWidth Issue.zip (5.9 KB)

Hi,

Thanks for the feedback
We are able to reproduce the issue and are currently investigating a fix.

Hi,

We have been able to fix this issue, the next version will address this.

1 Like

Thank you so much!