Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
770
After row deletion, next row become nothing.
posted

Hi guys.

I have a form that contains 3 wingrid. 2 datagrid works fine with row deletion, but not the other 1.

All of them have a delete button in each row, and all of them use the same codes.

Under clickcellbutton event for 3 datagrids, I have this code.

e.Cell.Row.Selected = True
        With dgSample.Selected
            If .Rows.Count > 0 Then
                dgGrid.DeleteSelectedRows(True)
                     
            End If
        End With

 

The problem is on a datagrid. If the datagrid consists of 3 rows of records, when I delete second row, the third row become nothing.

This doesn't happen in the other 2 datagrid.

 

Please help.

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    I don't understand what you mean by "when I delete second row, the third row become nothing".

    Are you saying that you are deleting the second row and the third row is removed instead of the second? Or that both the second and third rows are removed?

    I don't see how the grid could be causing either of those issues. My best guess would be that something in your code or in the data source is removing the wrong row.

Children
No Data