Results 1 to 4 of 4

Thread: Clearing msFlexGrid Control

  1. #1

    Thread Starter
    Lively Member Ishamel's Avatar
    Join Date
    Nov 1999
    Location
    Edinburgh, Scotland
    Posts
    112

    Post

    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.

    Code:
    grdGrid.Rows = 1
    Any advice/comments would be grately appreciated.


    [This message has been edited by Ishamel (edited 11-05-1999).]

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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



  3. #3

    Thread Starter
    Lively Member Ishamel's Avatar
    Join Date
    Nov 1999
    Location
    Edinburgh, Scotland
    Posts
    112

    Post

    Cheers Serge,

    I had a funny feeling it would be that simple.

  4. #4
    New Member
    Join Date
    Dec 1999
    Location
    USA
    Posts
    3

    Post

    I would certainly use
    FG.Rows = 1



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width