Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mshflexgrid, highlight selected row

Status
Not open for further replies.

hansu

Programmer
Mar 12, 2002
89
I'm stuck with the following problem:
When the user selects a row in a hierarchical flexgrid (flgReport) I retrieve a value from the selected row which is stored in Col 1.

I did it that way in the click event:
Code:
Private Sub flgReport_Click()
Dim strNum$
flgReport.Col = 1
strNum = flgReport.Text
End Sub

I'd like to keep the selected row highlighted as long as the user doesn't move to another row. But when I use the click event or also the mousedown event the row is only highlighted during clicking. Is there a way to set the properties to solve that problem?
 
hansu,

Do not use flgReport.Col = 1
Use strNum = flgReport.TextMatrix(1,flgReport.row)

vladk

 
Sorry, should be:

Use strNum = flgReport.TextMatrix(flgReport.row,1)
 
Thanks vladk
Works fine that way.
 
I am returning to this thread because the following is in the same context:
As mentionend above the mshflexgrid is bound to a hierarchical recordset. I want the user to be able to select rows of the parent recordset but not the rows of the child recordset. Does anybody know a way to prevent the selection of the rows bound to the child recordset?
Thanks for your assistance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top