PDA

Click to See Complete Forum and Search --> : Clearing msFlexGrid Control


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).]

Serge
Nov 4th, 1999, 08:29 PM
Yes, it is the best way to clear the grid.
Remember, less is more.....LOL

Regards,

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819

Ishamel
Nov 4th, 1999, 08:47 PM
Cheers Serge,

I had a funny feeling it would be that simple. :)

Temjin
Jan 6th, 2000, 01:23 PM
I would certainly use
FG.Rows = 1