The grid provides a simple ability to place rows or cells in visible area of the grid with Row.EnsureVisible() and Cell.EnsureVisible(). If necessary, the grid scrolls rows and columns. An example of this feature is provided below.

C# Copy imageCopy
public void EnsureVisibleExample(Grid grid)
{
    grid.Headers.Add(new Header());
    grid.Headers[0].Add(new Column("Price"));
    grid.Headers[0].Add(new Column("Quantity"));
    //Add more columns...

    grid.Rows.Add(new Product());
    Row row = grid.Rows[0];
    //Add more rows...

    //Ensure the row visible
    row.EnsureVisible();

    //Ensure the column visible
    grid.Headers[0]["Price"].EnsureVisible();


    //Ensure the cell visible
    row["Price"].EnsureVisible();
}

Back to .Net Grid HowTo topics