Solved

DecisionGrid problem

Posted on 1999-01-19
5
184 Views
Last Modified: 2010-04-06
How do I get the rowvalue and columnvalue for a selected cell in a DecisionGrid?
0
Comment
Question by:svenj
  • 2
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
viktornet earned 10 total points
ID: 1362426
Use MouseCoord()..... Somthing from the help file....

Returns the row and column indexes of the cell that contains a point specified in screen coordinates.

type TGridCoord = record

    X: Longint;
    Y: Longint;
  end;

function MouseCoord(X, Y: Integer): TGridCoord;

Description

Call MouseCoord to locate the column and row of the cell which contains a given screen coordinate. Usually, MouseCoord is used to locate the cell which is under the mouse.


-Viktor
--Ivanov
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1362427
You use MouseCoord() in the OnMouseDown() of the DecisionGrid so you check which one is selected.,,,
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1362428
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
0
 

Author Comment

by:svenj
ID: 1362429
Thank you viktornet,
That worked just fine, many thanks!

svenj

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1362430
a Misunderstanding!

meikl
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now