• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2726
  • Last Modified:

VB6 MsFlexGrid Deselect

Could someone advice me on how I could deselect (remove highlight) items from msflexgrid.

Thanks
0
oliverUK
Asked:
oliverUK
  • 4
  • 4
  • 3
  • +1
2 Solutions
 
PaulHewsCommented:
You should be able to change the .Row property.

MSFlexgrid1.Row = 1

However, it depends how you are doing the selecting and on the SelectionMode property.
0
 
PePiCommented:
if you have a header in your flexgrid then:

MSFlexgrid1.Row = 0: MSFlexgrid1.RowSel = 0
MSFlexgrid1.Col = 0: MSFlexgrid1.ColSel = 0


HTH!


0
 
mushu999Commented:
What you really want (and don't know it yet) is to use this free VB control as a replacement:

http://vcreations.net/product.asp?pID=1

It simply rocks!
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
oliverUKAuthor Commented:
Pepi your method doesn`t unselect the entire table it selects the 1st cell of the header.

PaulHews the FlexGrid is set to mode 0 - flexSelectionFree, in this mode your suggestion will highlight a cell on the 1st row depending on what  MSFlexgrid1.Col is assigned......

0
 
PePiCommented:
does your flexgrid have any fixed row or fixed cols ? try this:

MSFlexgrid1.Redraw = False
MSFlexgrid1.SelectionMode = flexSelectionByRow
MSFlexgrid1.Row = 0: MSFlexgrid1.RowSel = 0
MSFlexgrid1.Col = 0: MSFlexgrid1.ColSel = 0
MSFlexgrid1.SelectionMode = flexSelectionFree
MSFlexgrid1.Redraw = True
0
 
PePiCommented:
actually, you can just go like this:

With MSFlexgrid1
    .Redraw = False
    .SelectionMode = flexSelectionByRow
    .SelectionMode = flexSelectionFree
    .Redraw = True
End With
0
 
oliverUKAuthor Commented:
Thanks for your posts.
Unfortunately neither suggestion has the desired effect...
0
 
mushu999Commented:
FWIW, I think the points should NOT be refunded, since not only were they a "de minimus" amount, but this person also received several very useful and good answers to their question.
0
 
PaulHewsCommented:
The problem may be one of semantics.  There is no way to fully unselect a flexgrid, because .row and .col must have valid values.  However, you can make it remove the highlight that appears when multiple cells are selected, and that's what I thought he wanted.  That really is as simple as setting the row, because that resets both .rowsel and .colsel resulting in a single selected cell which will have no highlight.  It will have a focus rectangle, but only if the flexgrid is in focus.  

I'm fine with refund, I'm also fine with a split... whatever dude.


0
 
oliverUKAuthor Commented:
As I said thank you all for your efforts but no-one managed to solve the problem if anyone should get the points its Pepi/PaulHews for suggesting some real VB code.

Mushi999 supplied a fairly irrelavent link that did not answer the question, also if you don`t think the points are enough don`t complain afterwards just dont answer the question in the first place!
0
 
PaulHewsCommented:
> As I said thank you all for your efforts

I would rather that the question be deleted than have this kind of "thanks."  
0
 
oliverUKAuthor Commented:
Suits me - I solved the problem myself anyway
0
 
PaulHewsCommented:
What was the solution?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 4
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now