Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I tell which grid cell is active when a button is pressed?

Status
Not open for further replies.

kazl

Programmer
Dec 9, 2002
68
GB
Hi there Tek-Tips people - a question for you please:

I have a grid and a toolbar with a button "Copy to All".
I want the Copy to All button to take the value of the selected cell in the grid and copy it to the same field in every other record shown, to save retyping.

I have completed this the long way round, using the gotfocus events to store each field name as it's selected. But I will need to do this again elsewhere. Is there a simple way to tell what the active cell was when the toolbar button is pressed?

TIA.

Kaz
 
Kaz,

Use the grid's ActiveColumn property to find which column contains the active cell. Then look in the corresponding field of the current record in the table that is bound to the grid. That will give you the value you want.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Thanks Mike.
Very simple and right in front of me.
Have a good weekend.
Kaz.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top