Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

Returning row number problem with MSHFlexgrid

Hi,
I am trying to bold the text of the cell which is clicked upon in an MSHFlexgrid. The .row is being returned wrong though.
If I click on the 2nd row, it says .row = 1 when it should be 2.
If I click on the 3nd row, it says .row = 2 when it should be 3.
If I click on the 1st row, it tells me that the .row value is whatever the .row value was the last time I clicked on a cell when it should be 1.
I have one fixed row at the top and two columns.
I know the rows start at zero and this is not the problem. I assume there is a problem with the way I am setting up the flexgrid.
Has anyone any ideas where I'm going wrong?
Thanks for any help!
0
robinsql
Asked:
robinsql
1 Solution
 
TimCotteeCommented:
Hi robinsql,

Use .MouseRow in your _Click event for the flexgrid rather than the .Row property this is much better when dealing with clicks as sometimes the .Row property is not set until the event has been processed.

Tim Cottee MCSD, MCDBA, CPIM
http://www.timcottee.tk 

Brainbench MVP for Visual Basic
http://www.brainbench.com

Experts-Exchange Advisory Board Member
0
 
Arthur_WoodCommented:
probably what you are seeing the that the .Row returns the number of the row, NOT COUNTING any Fixed Rows.  When you say 2nd row, that is COUNTING the FIXED row, so it REALLY is the first row of actual data...

AW
0
 
avya2kCommented:
or try writing your code in Mouse_up event
0
 
robinsqlAuthor Commented:
Hi Tim,
Thanks. That worked with a little bit of tinkering.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now