?
Solved

Selecting rowitem of dbgrid in delphi

Posted on 2003-03-30
5
Medium Priority
?
258 Views
Last Modified: 2010-04-04
dear friends,
i want to access one item of row in dbgrid.
in deplhi i can access column by writing dbgrid1.column.items[0]..
it will fetch column only.
but i want to access row item for particular column.
how can i do that?

Please help me in this question?

Regards,
Rajkiran.
0
Comment
Question by:Rajkiran
[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
5 Comments
 
LVL 9

Expert Comment

by:ITugay
ID: 8237065
Hi Rajkiran,
ROW property of TDBGrid is not published, so, you can't access it directly.
TDBGrid does not store data row by row, it has different logic.
To access data with specified row number you have to access it in dataset instead of grid. Use .First .Last .Next .Prior methods of dataset to set cursor to desired record number (ROW as you called it).
____
Igor
0
 

Author Comment

by:Rajkiran
ID: 8237241
Thanks a lot igor.


Rajkiran.
0
 
LVL 9

Expert Comment

by:tkalchev
ID: 8237685
One solution is to go move your dataset to the appropriate row(record) and then to use dbgrid1.datasource.dataset.fieldbyname('your_field').As???
0
 
LVL 2

Accepted Solution

by:
Ratje earned 200 total points
ID: 8238002
type
  TMygrid = class(Tcustomgrid );
  TForm1 = class(TForm)
  etc
  etc


procedure TForm1.DBGrid1CellClick(Column: TColumn);
begin
  with TMygrid(DBGrid1) do
   ShowMessage(inttostr(row));
end;

Rat
0
 

Author Comment

by:Rajkiran
ID: 8238280
dear ratje,
thank you for providing solution.
i used this.
it solved my problem.

Regards,
Rajkiran.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

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