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

Hi I'm using the MSFlexGrid cont

Status
Not open for further replies.

darling

Programmer
Oct 25, 2001
14
GB
Hi

I'm using the MSFlexGrid control to display results based on text box and combo box inputs from the user. This works fine. I have a refresh button so the MSFlexGrid clears the results and text boxes to allow the user to imput some new options.

The problem is that althought the grid clears the data, it doesn't display the next results from the top position. It displays the new results half way down the grid (where the last ones stopped), so the user gets a load of blank lines and they have to scroll to the start of the next results.

Is there a way of going back to the top of the grid so that the new results will be displayed there?

Private Sub cmdRefresh_Click()
MSFlexGridResults.Clear
cboNWork.Text = ""
txtStart.Text = ""
txtEnd.Text = ""
cboNWork.SetFocus
End Sub

Any help would be fantastic!
Nora
 
try setting the .rows property to 0 or maybe 1 if you have headings - we actually set the property to be the same as the .fixedrows....
 
hi!
Do one thing, assign the default rows count while clear the grid information.But here you can lose the column header of that grid. Instead of trying this way you can go like this way

This is for clear the grid
with gridname
while (.rows-2>2)
.removerow(3)
do
end with

This is for adding the row

gridname.add "string",gridname.row-1

bye
Ravichandran.V
 
Thanks for all the help guys!

I appreciate it.

Ta again
Nora
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top