How to highlight row in MSFlexgrid 
Author Message
 How to highlight row in MSFlexgrid

I populate a MSflexgrid from an Access database. I also pupulate a
combobox from an Access databse. In the combo are the numbers of
members. They are also show in the MSflexgrid.
Is it possible to select a member from the combo so that the specific
row in the MSflexgrid is highlighted where the member number is shown.

Please help me. I am looking for days to find such routine
Thanx  



Wed, 07 May 2003 07:31:53 GMT  
 How to highlight row in MSFlexgrid
Nico:
Assuming you are using DAO and a DataControl, this code works

Private Sub Combo1_Click()
With MSFlexGrid1
    .SetFocus
    .Row = Combo1.ListIndex + 1
    .TopRow = Combo1.ListIndex + 1
    .RowSel = MSFlexGrid1.TopRow
End With

SendKeys "{LEFT}"  ' forces highlight
End Sub

Private Sub Form_Activate()
MSFlexGrid1.SelectionMode = flexSelectionByRow

Do While Not Data1.Recordset.EOF
 Combo1.AddItem Data1.Recordset("SomeFieldName")
 Data1.Recordset.MoveNext
Loop
Combo1.ListIndex = 0
Data1.Recordset.MoveFirst
MSFlexGrid1.SetFocus
End Sub

Regards,
-Toby

Quote:

>I populate a MSflexgrid from an Access database. I also pupulate a
>combobox from an Access databse. In the combo are the numbers of
>members. They are also show in the MSflexgrid.
>Is it possible to select a member from the combo so that the specific
>row in the MSflexgrid is highlighted where the member number is shown.

>Please help me. I am looking for days to find such routine
>Thanx  



Wed, 07 May 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to highlight row in MSflexgrid after search routine

2. need to preselect and highlight row 20 in 6 row unbound msFlexgrid

3. MsFlexGrid Control - Highlighting a row

4. highlighting a row in msflexgrid control

5. Programatically Highlight an MSFlexGrid Row

6. Highlighting a MSFlexGrid row

7. MSFlexGrid - Highlight specific rows

8. programmatically highlighting a row in MSFlexGrid

9. Need to Highlight Row and Column in MSFlexgrid

10. Highlight row in MSFlexgrid?

11. Problem highlighting last row added with MSFlexGrid 6.0

12. MSFlexGrid - detecting highlighted rows (VB5)

 

 
Powered by phpBB® Forum Software