Jump to content


Toofar's Content

There have been 2 items by Toofar (Search limited from 17-April 23)


By content type

See this member's

Sort by                Order  

#18499 Data constant update

Posted by Toofar on 05 May 2016 - 02:27 PM in NextGrid v6 Component

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;



#18497 Data constant update

Posted by Toofar on 05 May 2016 - 12:11 PM in NextGrid v6 Component

Hi,

 

I'm trying to constantly update a nextgrid from a trading source (opened positions) and fail to achieve this.

Could you please advice the best way to do that?

//____________________________________
//
//    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
    application.ProcessMessages;

 ....here some code to get the data


    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;
          end;
end;