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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find row/col of HFlexgrid when Right Clicking

Status
Not open for further replies.

olichap

Programmer
Joined
Mar 20, 2001
Messages
389
Location
US
I want to add a popup menu to an HFlexgrid that effectively allows the user to right click, copy one field's data, the right click again on a different cell and paste.

The problem is that the Click event on the HFlexgrid does not seem to recognize the Col/Row upon which I've clicked when using the Right mouse-button. The MouseUp event occurs before the Click event. Whether I have code in the MouseUp event or not, just Right clicking on a new field with a breakpoint on the Click event shows that the grd.col, grd.row properties do not seem to be set when using the right button.

Any ideas on how I can set this information and bring up my popup menu properly?

Thanks,

Oliver
 
Use the MouseRow and MouseCol properties in the MouseUp or MouseDown Events.

Mark
 
Excellent,

Thanks a lot for the answer and the timeliness of response.

Oliver
 
As a follow-up question, if the user clicks on a field/cell header (fixed row 0) I want to reorder my data accordingly.

When I click on row 0 (my fixed row) the grd.row property returns 1. How can I tell when the user clicks on row 0, thus allowing me to control the sort order?

Thanks,

Oliver
 
MouseRow is returning very strange numbers. For instance, if I click on col 6 of fixed row (0) MouseRow returns 10.

Any ideas?
 
Well, I feel like an idiot. Here I am setting my breakpoint on the click event, then using the immediate window to check the mouserow property. Only I forgot that that property changes as soon as I move the mouse to click on the immediate window.

Sorry, just a little bone-headed today.

Oliver
 
Yeah, pretty much. Thanks; just having one of those days.
 
I've been trying to do this for ages CHEERS from me too
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top