svenj
asked on
DecisionGrid problem
How do I get the rowvalue and columnvalue for a selected cell in a DecisionGrid?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You use MouseCoord() in the OnMouseDown() of the DecisionGrid so you check which one is selected.,,,
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.DecisionGrid1Decisi onDrawCell (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,ro w];
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
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.DecisionGrid1Decisi
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,ro
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
ASKER
Thank you viktornet,
That worked just fine, many thanks!
svenj
That worked just fine, many thanks!
svenj
a Misunderstanding!
meikl
meikl