TMS FNC Grid/TMS FNC Spread Grid Options - Grid.Objects Problem/Bug.

Hello,
I have been using TMS FNC Core and UI packs(Now the latest version to date).

In TMS FNC Spread Grid I tried using grid Multi-column sorting, where I also work with Grid.Objects property.

The sorting functionality works good in the latest version But-
with the multi-sort functionality, Grid.Objects are not being sorted parallelly because of the Event Grid.Selectedcell has not triggered anymore.

This is because, there is a private property in the TTMSFNCCustomGrid which is the parent grid of TTMSFNCSpreadGrid called BlockSelectEventHandler which should be set true(manually by making it public) for every grid option we use, and then making it false as shown.

TTMSFNCSpreadGrid = class(Vcl.TMSFNCSpreadGrid.TTMSFNCSpreadGrid)
  public
    property BlockSelectEventHandler;
  end;

procedure TfrmXXX.GridCellSortClick(Sender: TObject; ACol,
  ARow: Integer; ACell: TTMSFNCGridCell);
begin
  Grid.BlockSelectEventHandler := False;
end;

This should be done separately for all the grid options like Sorting/multi-sorting, Filtering, etc.,

This was not a problem in the older versions (for example version from January 2021.)

Is there something in the new versions that I need to know to use these options without creating a new class?

Regards,
Sorpetaler Fensterbau GmbH.

Hi,

Events such as OnSelectCell & OnSelectedCell are called when doing a selection via interaction. Events are not triggered when programmatically selecting a cell. Can you point out which code you are using and in which circumstances an issue rises?

Hello,

I have the problem when I use multi-sort functionality in TMS FNC SpreadGrid and then after the grid is sorted, now I am trying to select a single row and retrieve an object attached to the first cell of the particular row using Grid.Objects[0, row].

Here to fill the current row, I am using

procedure TfrmXXX.GridSelectedCell(Sender: TObject; ACol,
  ARow: Integer);
begin
  Row := ARow;
  col := ACol;
end;

This procedure is not called when I use multi-sort functionality in TMS FNC SpreadGrid, and hence the row value is old and I receive an old object with this call Grid.Objects[0, row].

I am also experiencing the same problem when using TTMSFNCGridFilteringOptions with dropdown.
Once the filtering is done and the grid is updated with new rows then I am not able to get the correct from these updated rows anymore.

Regards,
Sorpetaler Fensterbau GmbH.

Hi,

To retrieve the current selected/focused cell, you can use

TMSFNCGrid1.FocusedCell.Row
TMSFNCGrid1.FocusedCell.Col

instead of relying on an event handler.

1 Like

Hello,

Thank you, TMSFNCGrid1.FocusedCell.Row solves the problem when I am using Multi-sort functionality,
but the problem remains when I am using TTMSFNCGridFilteringOptions with dropdown.

Regards,
Sorpetaler Fensterbau GmbH.

Are you accessing cells? If so, you will need to convert the focused cell to the actual filtered cell which can be done by using TMSFNCGrid1.DisplToRealRow.