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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count number of rows shown in msflexgrid.

Status
Not open for further replies.

gruiz1998

Programmer
Jul 5, 2005
41
MX
Hi everyone!

I'm working with an msflexgrid control and need to know how many lines are displayed each time I scroll on the control, Any idea?

Thanks in advance!
 

Could you be more specific?

If your grid displays 10 rows of data (it's what the user can see) and you have 100 rows of data in your grid, your user can see just 10 rows at the time, no matter if you scroll or not.

Unless you have just 5 rows of data in your grid (you still CAN display 10 rows) - your user can see just 5 rows.

Unless I am missing something..... (which is possibile :) )

Have fun.

---- Andy
 
Thank you for your answer.

I have a msflexgrid which I fill from an ADO recordset, this recordset can contain from 5 results to more than 1000, I realize that I can resize the msflexgrid control to show up to 10 rows, however I have another controls to navigate through the msflexgrid, one row at a time or "by page" (10 rows at a time). I need to know at all times which row is the one "highlighted" cause I think is a way to link the navigation controls with the arrow keys, at this moment If I start to navigate with the control from an initial position and pass any number of rows or pages and then press the arrow keys, it goes back to the initail point.

I haven`t been able to figure out how to solve this problem.

If you have any ideas these will be more tha welcome.

Thank you!
 

I don't know if that will help, but the FlexGrid has a [tt] .TopRow[/tt] property, which sets which row is displayed at the top of your flexgrid control.
Code:
msflexgrid.TopRow = 5
will display 5th record at the top of the grid.

Have fun.

---- Andy
 
I'm afraid it doesn`t help me, thank you anyway.

Regards
 
I need to know at all times which row is the one "highlighted" so that I can scroll with the arrow keys (keyboard) or with my navigation controls and be consistent with the "navigation".
 
DIM ActiveRow as Integer

Private Sub MSFlexGrid1_EnterCell()
If MenuIsActive = True Then ' you may not need this boolean
With MSFlexGrid1
ActiveRow = .Row
' Maybe do something
End With
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top