Results 1 to 5 of 5

Thread: Row selection by code in MsFlexGrid

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241

    Post

    When I assign a value to the row proterty of my flexgrid it doesn't actually show the selection on the grid. Is there a way to make it draw or show the selection?

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241

    Post

    Comme on ... someone MUST know!?!

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    I use DbGrids, so anything I offer is no better than a guess. If you change the selectionmode property to 1 (selectrows), does that help?

    The other thing I'd look at is the rowsel, which looks like it needs to be set *after* the row property.

  4. #4
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    You need to Set the Row Property to the Row you want Selected, then you need to Set the ColSel Property to the Last Column in the Row, eg.
    Code:
    Private Sub Command1_Click()
        MSFlexGrid1.Row = (MSFlexGrid1.Row + 1) Mod MSFlexGrid1.Rows
        MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
    End Sub
    
    Private Sub Form_Load()
        With MSFlexGrid1
            .Rows = 0
            .Cols = 2
            .SelectionMode = flexSelectionByRow
            .FocusRect = flexFocusNone
            For I = 1 To 10
                .AddItem "Row Item 1" & Chr(9) & "Extra Data"
            Next
            .FixedRows = 0
            .FixedCols = 0
        End With
    End Sub

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241

    Post

    Cool it works Great! Thanks a lot!

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