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
555
Remove selected row from UltraGrid
posted

Hi

How to remove selected row from UltraGrid ??

Parents
No Data
Reply
  • 235
    posted

    Hi princekp,

    If you are trying to remove the last row - the one on the bottom of the grid, try this:

    // C#
    yourUltraGrid.Rows[yourUltraGrid.Rows.Count - 1].Delete();

    ' VB
    yourUltraGrid.Rows(yourUltraGrid.Rows.Count - 1).Delete()

    If you are trying to delete the last few rows from the bottom of the list, try this:


    // C#
    int RowsToDelete = 4;
    for (int i = 0; i < RowsToDelete; i++)
    {
        yourUltraGrid.Rows[yourUltraGrid.Rows.Count - 1].Delete();
    }

    ' VB
    Dim RowsToDelete As Integer = 4
    For i As Integer = 0 To RowsToDelete:
        yourUltraGrid.Rows(yourUltraGrid.Rows.Count - 1).Delete()
    Next i

    If you are trying to delete all rows, try this:


    // C#
    yourUltraGrid.DeleteSelectedRows();

    ' VB
    yourUltraGrid.DeleteSelectedRows()

Children
No Data