Link to home
Start Free TrialLog in
Avatar of Rajkiran
Rajkiran

asked on

Selecting rowitem of dbgrid in delphi

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.
Avatar of Igor UL7AAjr
Igor UL7AAjr
Flag of Kazakhstan image

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
Avatar of Rajkiran
Rajkiran

ASKER

Thanks a lot igor.


Rajkiran.
One solution is to go move your dataset to the appropriate row(record) and then to use dbgrid1.datasource.dataset.fieldbyname('your_field').As???
ASKER CERTIFIED SOLUTION
Avatar of Ratje
Ratje

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
dear ratje,
thank you for providing solution.
i used this.
it solved my problem.

Regards,
Rajkiran.