Solved

DecisionGrid problem

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

776 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