Link to home
Start Free TrialLog in
Avatar of svenj
svenj

asked on

DecisionGrid problem

How do I get the rowvalue and columnvalue for a selected cell in a DecisionGrid?
ASKER CERTIFIED SOLUTION
Avatar of viktornet
viktornet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You use MouseCoord() in the OnMouseDown() of the DecisionGrid so you check which one is selected.,,,
Avatar of kretzschmar
Hi Viktornet,

i don't think that your answer reflected the question. To get the Value of the selected Cell allways (by click or keyboard) he can use this in DecisionDrawCel Event of the DecisionGrid

procedure TForm1.DecisionGrid1DecisionDrawCell(Sender: TObject; Col,
  Row: Integer; var Value: String; var aFont: TFont; var aColor: TColor;
  AState: TGridDrawState; aDrawState: TDecisionDrawState);
begin
  if (gdselected in aState) then
    edit2.text := DecisionGrid1.Cells[col,row];
end;

But I think he/she will access the sum values of the Row and of the Colum of the selected Cell. Not so Easy.

meikl
Avatar of svenj
svenj

ASKER

Thank you viktornet,
That worked just fine, many thanks!

svenj

a Misunderstanding!

meikl