How do I determine the sort fields on a TTMSFNCDataGrid

Hello,

In a Web Core application I have a TXDataWebDataSet connected to a TWebDataSource, which in turn is connected to a TTMSFNCDataGridDatabaseAdapter that is ocnnected to a TTMSFNCDataGrid.

The TXDataWebDataSet is loaded and then disconnected from the source.

The TTMSFNCDataGrid allows for column sorting by the user by clicking on the headers.

My question is, how do I determine if the gris is currently sorted and what datafield is it sorted by?

Thnaks,

Alan

Hi,

Let me ask first: is the LoadMode of the database adapter set to load all records? If so, then it uses the built-in data grid filtering. To retrieve which column is sorted use:

var
  s: TTMSFNCDataGridSortIndex;
begin
  for s in TMSFNCDataGrid1.SortIndexList do
  begin
    //s.Column;
    //s.Direction;
  end;

Yes, it is.
I’ll give it a try.

Thanks,

Alan