Hopefully this will be my last question. I have a problem with the column width changing between different shows and activations of the form. On the first show the column widths are set fine but thereafter they revert to default column widths.
I am doing this on formshow :
gdOrderLinesTMS.ColumnWidths[0] := 80;
gdOrderLinesTMS.ColumnWidths[1] := 250;
gdOrderLinesTMS.ColumnWidths[2] := 80;
gdOrderLinesTMS.ColumnWidths[3] := 120;
gdOrderLinesTMS.ColumnWidths[5] := 80;
gdOrderLinesTMS.ColumnWidths[5] := 120;
gdOrderLinesTMS.ColumnWidths[6] := 120;
gdOrderLinesTMS.ColumnWidths[7] := 120;
Then on reopening the form it looks like this :
Is there event that I should rather set the column widths ? I have tried doing it on paint.
I could not reproduce an issue. You refer to: "when I reopen the form"... what exactly does this technically mean? Is this a hidden form you open again or you recreate the form instance and display it?
When the form is reopened, is it going again through the FormShow event?
No, sorry I am not hiding it and then reshowing, in this case I am clicking the + button to add an item. This does a showmodal of another form like this :
if datamod.mtOrderHeaderDEBTOR_ID.AsString = '' then begin
messagedlg('Please select a customer',System.UITypes.TMsgDlgType.mtError ,[TMsgDlgBtn.mbOK],0);
How exactly to reproduce? When dropping a default TTMSFMXGrid on the form and setting the column width via design time editor for grid.Columns[x].Width: integer, this width is reflected when running the app. What are you doing different?
I removed anchoring and no change, Grip is align to top, I have 4 columns the first 2 is small (60)and the next 2 need to be biggeg (200) . even set defaultcolumnsize to 0 , but all the columns are the same size
Ich habe ein Problem mit TMXFMXGrid. Die Daten lassen sich im Grid editieren, werden aber nicht auf die Datenbank zurückgeschrieben. Ich arbeite mit Delphi XE8
To write to the grid, you need to directly write to the database instead of writing to the grid cells. The grid cells are automatically filled with data, and the editing occurs internally. In the SelectCell event the dataset is not set in edit mode.
I have a problem with the TMSFMXLifeGrid. The database pointer is not equal to the pointer of TMSFMXLifeGrid.Wenn on the grid, the second record is CHANGED, in the table of the first data set is overwritten. You have a solution?
Please note that the ARow parameter is 1 for the first record if fixedrows are used and thus needs to be subtracted by 1.
Pieter Scheldeman2015-08-12 15:50:25
You have misunderstood. When I press on the grid to col 2 and the data mutate, the data from the first record in the table is mutated. Table and Grid do not have the same record.