Delete any Row for FlexGrid

VB6 MSFlexGrid Control

Using an unbound flexgrid, how can I delete an entire row from the middle of a table. A .DeleteItem in conjuction with the .Additem would have been nice.

Just Clearing the data from the cells does not really help, becuase of the blank row that remains.

Suggestions?

Comments

  • Answering my own question

    Ths will delete the currently selected row

    flexgrid.RemoveItem flexgrid.Row

    Just make sure you are not trying to delete a Header Row, or that last visable row.

    Thanks :)

    : VB6 MSFlexGrid Control
    :
    : Using an unbound flexgrid, how can I delete an entire row from the middle of a table. A .DeleteItem in conjuction with the .Additem would have been nice.


  • : VB6 MSFlexGrid Control
    :
    : Using an unbound flexgrid, how can I delete an entire row from the middle of a table. A .DeleteItem in conjuction with the .Additem would have been nice.
    :
    : Just Clearing the data from the cells does not really help, becuase of the blank row that remains.
    :
    : Suggestions?
    :
    :

  • : Answering my own question
    :
    : Ths will delete the currently selected row
    :
    : flexgrid.RemoveItem flexgrid.Row
    :
    : Just make sure you are not trying to delete a Header Row, or that last visable row.
    :
    : Thanks :)
    :
    : : VB6 MSFlexGrid Control
    : :
    : : Using an unbound flexgrid, how can I delete an entire row from the middle of a table. A .DeleteItem in conjuction with the .Additem would have been nice.
    :
    :
    :

    You also cannot delete the last non fixed row. This is what I do:

    [code]WIth MSFlexGrid1
    If (.Rows > .FixedRows + 1) Then
    .RemoveItem .Row
    Else
    .Rows = .FixedRows
    End If
    End With[/code]

  • I used this code to delete the last row of flex gird. but error come out like "Sub or Function not defined"
    The following are my coding. I look forward your reply.

    Private Sub Cmddelete_Click()
    Dim ItemFlexGrid As MSHFlexGrid

    If MsgBox("Do you want to remove this record?", vbYesNo) = vbYes Then
    With ItemFlexGrid
    If (.row > .FixedRows + 1) Then
    .RemoveItem .row
    Else
    .row = .FixedRows
    End If
    Endwith
    End If
    End Sub
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories