A docked row is not engaged in sorting and always stays in place. You can use Row.Dock. property to dock a row. Please see an example of docking below.

C# Copy imageCopy
public void RowDockingExample(Grid grid)
{
    //Dock row to the top
    Row row1 = grid.Rows[4];
    row1.Dock = RowDockStyle.Top;

    //Dock row to the bottom
    Row row2 = grid.Rows[5];
    row2.Dock = RowDockStyle.Bottom;

    //Undock the row
    grid.Rows[0].Dock = RowDockStyle.None;
}

Back to .Net Grid HowTo topics