Jump to content


Toofar

Member Since 05 May 2016
Offline Last Active May 05 2016 03:59 PM
-----

Posts I've Made

In Topic: Data constant update

05 May 2016 - 02:27 PM

I've moved the process message and added the begin update.

But I only got the first line. I've checked thru step by step and the two lines are updated and correctly stored in the nxtrades grid.

and the grid is blincking.

Just for precision. This process could happens many times per second.

//____________________________________
//
//    EVENTS ROW CHANGED
//_____________________________________
procedure TfCore.TradeDeskEventsSink1RowChanged(ASender: TObject;
  const pTableDisp: IDispatch; const sRowID: WideString);
var
    Count_ , trowcount, tcolcount: Integer;
begin
//data processing for Row Changed Events


 ....here some code to get the data

    nxtrades.BeginUpdate;
    nxtrades.ClearRows;
    nxtrades.AddRow;
    
     for irow := 1 to tRowCount do
          begin
          Nxtrades.Cell[nxtradeid.index,nxtrades.lastaddedrow].asstring := toRows.Item(irow).TradeID;
          Nxtrades.Cell[nxAccountID.index,nxtrades.lastaddedrow].asstring := toRows.Item(irow).AccountID;
... 20 differents lines goes here...
          end;
Nxtrades.EndUpdate;
 application.ProcessMessages;
end;