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

Clearing a flexgrid

Status
Not open for further replies.

JasonV

MIS
Jun 9, 1999
10
0
0
US
Hi,<br>
<br>
I'm using a command button to run a procedure that adds data from a database to a flexgrid based on criteria from a textbox. I load column headers of the flexgrid in Form_load(). Once this procedure is done and rows have been added to the flexgrid, I want to be able to put different criteria in the textbox and run the procedure again but also clearing the existing data in the grid. I have tried using gridMyGrid.clear but its clearing my column headers and existing rowData and also adding the new rows after the # of rows of previous rowData. Can anyone suggest what to do to clear the grid and keep my headings. The headings are a fixed row. Thanks. Jason
 
You can create a function where you initialize your column headers.<br>
One way you may want to try is grdmygrid.rows = 1 it works sometimes.<br>

 
public sub ClearGrids()<br>
dim a as integer<br>
dim b as integer<br>
with myGrid 'change this to your flexgrid name<br>
.redraw = false<br>
for a = 1 to .rows -1<br>
for b = 1 to .cols -1 <br>
.row = a: .col = b: .text = ""<br>
next b<br>
next a<br>
.redraw = true<br>
end with<br>
end sub<br>
<br>
this should work for you....let me know if not<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top