Link to home
Start Free TrialLog in
Avatar of samenglish
samenglishFlag for Australia

asked on

How to select (highlight and receive focus) entire text of selected cell in Delphi DBGrid?

Hello,

I have a simple DBGrid, DBNavigator, and an 'Edit' button which simplly calls DBNavigator.BtnClick(nbEdit);

When the user clicks Edit, I want the text in the selected cell (just the text - not the whole cell) to be highlighted - as if ready to be overwritten; whereas when I do DBGid.SetFocus then DBNavigator.BtnClick(nbEdit) the whole cell is highlighted.

how can I select the entire text of a selected cell (or alternatively simulate 2 mouse clicks programatically)

Thanks in advance for all efforts.
What-I-Want.JPG
Not-What-I-Want.JPG
ASKER CERTIFIED SOLUTION
Avatar of Ferruccio Accalai
Ferruccio Accalai
Flag of Italy image

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
SOLUTION
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
SOLUTION
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
You could check out NextGrid, it's a fairly cheap grid component compared to other payed components. I believe it also has a DBGrid version. http://www.bergsoft.net/component/next-grid/overview.htm
It has a lot of fieldtypes, including editable fields. It alos allows you to make "slides". The control is not as advanced maybe as DevExpress' grid components, but it's easy to use, has a lot of features and might be just what you need. there's a demo you can download. I'm pretty satisfied with the component anyway, with a lot of BergSoft's components actually.
Avatar of samenglish

ASKER

Ferruccio68 and Geert Gruwez: real experts - thank you.
gurkal: thanks for the extra useful info, I appreciate it.
Freddy1990: honourable mention, I'll keep that in mind.