Solved

DecisionGrid problem

Posted on 1999-01-19
5
186 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi Form ownership 4 73
oracle global variables 4 63
Firemonkey android show image from resource ? 1 33
How to build JSON File in Delphi 6 3 14
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

867 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

16 Experts available now in Live!

Get 1:1 Help Now