PDA

Click to See Complete Forum and Search --> : Row selection by code in MsFlexGrid


David Laplante
Nov 4th, 1999, 10:45 PM
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?

David Laplante
Nov 5th, 1999, 01:15 AM
Comme on ... someone MUST know!?!

JHausmann
Nov 5th, 1999, 02:10 AM
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.

Aaron Young
Nov 5th, 1999, 03:20 AM
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.

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
aarony@redwingsoftware.com
adyoung@win.bright.net

David Laplante
Nov 5th, 1999, 04:03 PM
Cool it works Great! Thanks a lot! :)