Ishamel
Nov 4th, 1999, 07:48 PM
What is the best method of clearing an msFlexGrid control?
I originally used the following code to clear a grid, but I wanted to use a quicker method, because there could sometimes be fair amount of rows on the grid.
Do While MSFlexGrid1.Rows > 1
MSFlexGrid1.RemoveItem(1)
Loop
'Grid is cleared
I now use the following code, because it is quicker, however the Clear method clear's Column header's, so I have to reset them each time.
MSFlexGrid1.Clear
MSFlexGrid1.Rows = 1
'Grid is cleared - re-enter the column headers
Is there a better way of clearing the grid without having to reset the column headers?
I'm not sure if this works. It appears to clear all rows from the grid and leave the column header's, but it just seems too simple.
grdGrid.Rows = 1
Any advice/comments would be grately appreciated.
[This message has been edited by Ishamel (edited 11-05-1999).]
I originally used the following code to clear a grid, but I wanted to use a quicker method, because there could sometimes be fair amount of rows on the grid.
Do While MSFlexGrid1.Rows > 1
MSFlexGrid1.RemoveItem(1)
Loop
'Grid is cleared
I now use the following code, because it is quicker, however the Clear method clear's Column header's, so I have to reset them each time.
MSFlexGrid1.Clear
MSFlexGrid1.Rows = 1
'Grid is cleared - re-enter the column headers
Is there a better way of clearing the grid without having to reset the column headers?
I'm not sure if this works. It appears to clear all rows from the grid and leave the column header's, but it just seems too simple.
grdGrid.Rows = 1
Any advice/comments would be grately appreciated.
[This message has been edited by Ishamel (edited 11-05-1999).]