TMSFNCDataGrid + TAureliusDataset.Current<T> not updated in OnCellAnchorClick

Hello,

I'm migrating some grids from TMSFNCGrid to TMSFNCDataGrid and I've noticed a different behaviour regarding the OnCellAnchorClick event.

The grid is bound to a TAureliusDataset. Inside the OnCellAnchorClick event I access the current entity using:

TAureliusDataset.Current<T>

With TMSFNCGrid, this always returned the entity corresponding to the clicked row.

With TMSFNCDataGrid, when I click on a hyperlink cell, Current<T> still points to the previously selected record. The current record is only updated if I click on a normal (non-hyperlink) cell.

Is this expected behaviour? Does OnCellAnchorClick fire before the grid synchronizes the current record with the dataset, or is there a property or setting I should enable to make it behave like TMSFNCGrid?

Thank you in advance.

Kind regards,

Daniel Castro

Hi,

The OnCellAnchorClick fires without changing selection, this is deliberate. It will be called with correct coordinates, but we wanted to separate that behavior. To align the current record, you will have to call SelectCell() inside the OnCellAnchorClick.

Hi Pieter,

That solved the problem. Thank you very much!

Kind regards,

Daniel Castro