Results 1 to 5 of 5

Thread: [RESOLVED] VB6 MshFlexGrid select full row problem (even with flexSelectionByRow enabled)

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Location
    Scotland
    Posts
    15

    Resolved [RESOLVED] VB6 MshFlexGrid select full row problem (even with flexSelectionByRow enabled)

    Hello all

    I've been having numerous difficulties with showing a full row on a MSHFlexGrid as being selected. This has come up on several grids i have developed.

    I want users to be able to select one record and only one record at any given time. When they click on a record, it should highlight the whole row and not just part of it.

    This is a problem of formatting and presentation - it looks awful when the user clicks a row and only part of it goes blue. Sometimes it is only the left-most cell that stays white.
    On one grid, when the user uses a keyboard shortcut to activate the grid control, only columns 4 onwards are highlighted on the selected row, even if the user uses the cursor keys to move up and down. Puzzlingly, if a row is selected with the mouse, the full row is highlighted.

    The properties of the grids that i have set are:

    RowSizingMode - flexRowSizeIndividual
    SelectionMode - flexSelectionByRow
    Highlight - flexHighlightAlways
    Redraw - True
    AllowBigSelection - False
    FixedRows - varied, no change to results
    FixedCols - varied, no change to results

    Is there any hard and fast way to ensure that a row clicked on a MSHFlexGrid will be highlighted in its entirety, no matter how many columns or rows it has, by setting any of the above attributes or any other ones?

    many thanks

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: VB6 MshFlexGrid select full row problem (even with flexSelectionByRow enabled)

    Do you mean this:

    VB Code:
    1. Private Sub MSFlexGrid1_Click()
    2.     With MSFlexGrid1
    3.         .Col = 0
    4.         .ColSel = .Cols - 1
    5.     End With
    6. End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Location
    Scotland
    Posts
    15

    Re: VB6 MshFlexGrid select full row problem (even with flexSelectionByRow enabled)

    Hi Gavio

    funnily enough those lines of code worked beautifully on one of my grids but not the other one i tried!!
    i'm happy to have at least one grid resolved and can hopefully get more clues from this as to why the other one(s) don't work as well...

    thanks

  4. #4
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: VB6 MshFlexGrid select full row problem (even with flexSelectionByRow enabled)

    take an out of the box MSHFlexGrid.

    change:
    FocusRect = 0 - flexFocusNone
    SelectionMode = 1 - flexSelectionByRow

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Location
    Scotland
    Posts
    15

    Talking Re: VB6 MshFlexGrid select full row problem (even with flexSelectionByRow enabled)

    Yessssss! Result.
    very happy.
    many thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width