Filtering TTMSFMXGrid with Livebindings


This is my problem. I fill a TTMSFMXGrid with a TBindSourceDBX and I set
when the user applies a filter, it works fine but if I need to refresh the datas by changing parameters in the stored procedure attached to theTBindSourceDBX when a filter is applied , an exception occures:

EListError index out of bounds, then EBindCompError: Evalerror in LinkGridToDataSource
after that, the grid is displayed empty and each attempt to refresh as the same effect.
I tried to clear the filters before refreshing with
myGrid.Filter.clear and myGridFilterListBox.clear without any success


Filtering only needs to be applied to the dataset, so the data is updated accordingly. Filtering on the grid is only supported without LiveBindings. You can try the following code, and update the stored procedure with the filter condition on the correct column. The grid will display the data filtered, but without an active filter internally in the grid.

procedure TForm1.TMSFMXGrid1FilterSelect(Sender: TObject; Col: Integer;
  var Condition: string);
  Condition := '';
  //apply filtering to dataset and refresh data

Kind Regards, 

Pieter Scheldeman2013-10-01 06:28:28

Thanks for you answer. I also noticed that, when sorting column, selecting a row does not return the corresponding record of the dataset. Is it the same reason, sorting is not suppported with livebindings?
Kind regards