?
Solved

DecisionGrid problem

Posted on 1999-01-19
5
Medium Priority
?
194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
viktornet earned 40 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

770 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