-
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.
Code:
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.
Code:
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.
Any advice/comments would be grately appreciated.
[This message has been edited by Ishamel (edited 11-05-1999).]
-
Yes, it is the best way to clear the grid.
Remember, less is more.....LOL
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Cheers Serge,
I had a funny feeling it would be that simple. :)
-
I would certainly use
FG.Rows = 1