HitTest运用:在cxGrid上移动时获取记录的值

procedure TForm1.cxGrid1DBTableView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);  

var  

  AHitTest: TcxCustomGridHitTest;  

  AValue: Variant;  

  ARowIndex, ARecIndex: Integer;  

begin  

  AHitTest := (Sender as TcxGridSite).GridView.ViewInfo.GetHitTest(X,Y);  

  if AHitTest.HitTestCode = htCell then  

  begin  

    with TcxGridRecordCellHitTest(AHitTest) do  

      ARecIndex := TcxGridRecordCellHitTest(AHitTest).GridRecord.RecordIndex;  

    ARowIndex := cxGrid1DBTableView1.DataController.GetRowIndexByRecordIndex(ARecIndex, True);  

    ...  

  end;  

end;


联系电话:
020-00000000
联系电话:
020-00000000
联系电话:
020-12345678