Grid

Adding Data

Methods for adding rows, columns, and individual cells to a GPAL grid.

Methods for adding rows, columns, and individual cells to a GPAL grid.

GPALGrid is a two-dimensional in-memory data structure used throughout GPAL to pass tabular data between subsystems. AddRow appends a List<T> as a new row at the end of the grid. AddColumn appends a List<T> as a new column. AddCell inserts a single value at a specific row and column position. All three methods return the same grid instance for fluent chaining.

TIP

Rows and columns are zero-indexed. AddCell(value, 0, 0) sets the first cell. If a row or column does not yet exist at the specified index, GPAL creates it.

Examples

GPAL Fluent: High-level fluent C# API

//GPAL.Grid returns a new grid instance. ToGPALObject() returns it as IGPALGrid<string> for use as a parameter in other GPAL methods. For grids with typed values other than string, use GPAL.GridForType<T>().

// Build a grid manually var grid = GPAL.Grid.ToGPALObject(); grid .AddRow(new List<string> { "Name", "Email", "Status" }) .AddRow(new List<string> { "Alice", "alice@example.com", "active" }) .AddRow(new List<string> { "Bob", "bob@example.com", "inactive" }); // Set a specific cell grid.AddCell("updated@example.com", 1, 1);