Results 1 to 5 of 5

Thread: **Resolved** Remove & Add rows to a MSHflexGrid?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    13

    Question **Resolved** Remove & Add rows to a MSHflexGrid?

    I Know how to delete and add rows to a MSHFlexGrid but
    this occurs:

    1.- I add row 1 and write in it, fine
    2.- I add row 2 and write in it, fine
    3.- I delete row 1, and it works.
    4.- I add another row (row 2) and this row isnt displayed
    5.- I add another row (row 3) and row 2 is displayed

    what i have to do for the Grid properly refreshes

    thanks
    Last edited by Oscar Ashkroft; Apr 11th, 2003 at 10:52 AM.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Try the .Refresh method of the grid.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    13

    Unhappy negative

    i checked it out

  4. #4
    Hyperactive Member
    Join Date
    Nov 2001
    Location
    Albany, NY
    Posts
    489
    Thank you!

    I've had this problem before multiple times.
    I've heard there is a fix if you update to
    Service Pack 6 or something but I just created
    a remove function that works. The .Remove
    method is the proplem.

    Pass the grid and the row to this sub to
    remove the row.

    VB Code:
    1. Public Sub RemoveRow(ByRef p_MSHFlexgrid As MSHFlexGrid, p_RowIndex As Integer)
    2.  
    3.     Dim rowIndex As Integer
    4.     Dim colIndex As Integer
    5.  
    6.     For rowIndex = p_RowIndex To p_MSHFlexgrid.Rows - 2
    7.         For colIndex = 0 To p_MSHFlexgrid.Cols - 1
    8.             p_MSHFlexgrid.TextMatrix(rowIndex, colIndex) = p_MSHFlexgrid.TextMatrix(rowIndex + 1, colIndex)
    9.         Next
    10.     Next
    11.  
    12.     p_MSHFlexgrid.Rows = p_MSHFlexgrid.Rows - 1
    13.  
    14. End Sub

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    13

    thanks for everything, anyway


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