Grid

Deleting Data

Methods for removing rows and clearing all data from a grid.

Methods for removing rows and clearing all data from a grid.

DeleteRow removes a row by index or by position (first or last). Clear removes all data from the grid, leaving an empty grid object ready for reuse. Both methods return the same grid instance for fluent chaining. DeleteRow(Enums.RowPosition) accepts Last (the default) to remove the last row - useful when processing a queue where you remove each row after handling it.

Examples

GPAL Fluent: High-level fluent C# API

//DeleteRow(RowPosition) accepts Last by default (removes the last row) or First (removes the first row). DeleteRow(int) removes the row at that zero-based index, shifting remaining rows up.

// Remove the last row grid.DeleteRow(); // Remove row at index 2 grid.DeleteRow(2); // Clear all data and reuse the grid grid.Clear() .AddRow(new List<string> { "fresh", "data" });