Delete a row in MSFLEXGRID

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GROG
    New Member
    • Sep 2007
    • 34

    Delete a row in MSFLEXGRID

    Hi guys, how to delete a row in msFlexgrid? I have no problem in adding one... let say i have 5 rows, and i want to delete a row... the 3rd one.. Thanks
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    Are you Looking for this :

    Grd.RemoveItem 2
    ' Zero Based 2=3rd row

    Regards
    Veena

    Comment

    • GROG
      New Member
      • Sep 2007
      • 34

      #3
      [Thanks a million veen... but i still have a problem..
      i just "can't delete the last row of a non-fixed row" ( that was the error message looks like) ... is it possible to delete it? or how can i manipulate this error to be an input/trigger for my next action..? if its really cant be romoved i would like to empty the whole row.. but the row still there...

      e.g

      given;
      errorr 30015 ="can't delete the last row of a non-fixed row"

      On error30015 goto err <<<--- is this the right syntax?

      err:
      Msflexgrid.text matrix (XX,YY) = ""

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi,

        When rows are 2 (with one fixed row...) you cannot delete the last row with remove item..
        just use this :

        [code=vb]
        If Grd.Rows=2 Then
        Grd.Rows =1
        Else
        Grd.RemoveItem Grd.Row
        "Removes Selected Row, Change this if using a Variable..
        End If
        [/code]

        REgards
        Veena

        Comment

        • GROG
          New Member
          • Sep 2007
          • 34

          #5
          Thanks again, it is really a big help.... :)

          Comment

          Working...