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

MSHFlexGrid ignoring mouse click

Status
Not open for further replies.

davem1958

Programmer
Oct 10, 2001
17
US

I'm using an MSHFlexGrid, binding it to an ADO recordset, then closing the recordset (so now it's unbound).

I have all the code to load the grid in a subroutine called 'RefreshData'

I call RefreshData inside Form_load, and also when a user clicks a button.

The problem is, after a Form_load, it works fine. After a manual Refresh, something about the grid causes it to start ignoring mouse clicks. For example, say the first row is highlighted. I click on the 2nd row, and put a

Debug.print grd.Row

statement inside every possible event: EnterCell, LeaveCell, RowColChange, and SelChange. In every case, the Row property says "1", even though I just clicked on the 2nd row.

If I close the form, re-open it (avoiding the manual Refresh), it works fine again.

Any ideas?

Dave.
 
What happens if you click on the third row etc. How many fixed rows do you have.
 
I've found the problem, but no idea what the solution is.

In this case, I only have two rows, plus a fixed row.

Turns out if I click below row 2 (where a 3rd row 'would' be), it moves to Row 2.

If I click on Row 2, it moves to Row 1.

Bug or feature?

Dave
 
The first row after a fixed row will always return a value of 1, and subsequent rows = 2,3,4 etc. What do you mean by "where a 3rd Row Would Be". Is there a row there?.
Do you have any Click events on the grid that are taking over. Maybe someone else has some thoughts, even try replacing the grid.
 
>>What do you mean by "where a 3rd Row Would Be". Is there >>a row there?.

No, just a blank grid.

>>Do you have any Click events on the grid that are taking over.

No, only event I'm trapping is SelChange -- and the Row property is off by 1 even before the event code runs.

Dave.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top