There can be many such events and only some of them are needed for more applications. Below we provide a list of some events that may interest programmers:

C# Copy imageCopy
public void SubscribeForEvents(Grid grid)
{
    row.Grid.PaintCell += delegate(object sender, PaintCellEventArgs e)
    {
        Console.WriteLine("Paint cell event: row = {0}, column = {1})", e.Cell.Row.VisibleIndex, e.Cell.Column.Id);
    };

    grid.CellClicking += delegate(object sender, GridCellEventArgs e)
    {
        Console.WriteLine("The user is clicking on the cell: row = {0}, column = {1})", e.Cell.Row.VisibleIndex, e.Cell.Column.Id);
    };

    grid.CellClicked += delegate(object sender, GridCellEventArgs e)
    {
        Console.WriteLine("The user has clicked on the cell: row = {0}, column = {1})", e.Cell.Row.VisibleIndex, e.Cell.Column.Id);
    };

    grid.HeaderAdded += delegate(object sender, GridHeaderEventArgs e)
    {
        Console.WriteLine("A header has been added on the {0} hierarchical level", e.Header.Level);
    };

    grid.HeaderHeightChanged += delegate(object sender, GridHeaderEventArgs e)
    {
        Console.WriteLine("The new height of the header = {0}", e.Header.Height);
    };

    grid.ColumnAdded += delegate(object sender, GridColumnEventArgs e)
    {
        Console.WriteLine("The column '{0}' has been added to the grid", e.Column.Id);
    };

    grid.ColumnMoved += delegate(object sender, GridColumnEventArgs e)
    {
        Console.WriteLine("The column '{0}' has been moved to {1} position", e.Column.Id, e.Column.VisibleIndex);
    };

    grid.RowUpdated += delegate(object sender, GridRowUpdateEventArgs e)
    {
        int threadId = Thread.CurrentThread.ManagedThreadId;
        Console.WriteLine("The data object has been updated. Row = {0}, Field = {1}, Value = {2}, Thread = {3}", e.Row.VisibleIndex, e.DataField.Id, e.DataField.Value, threadId);
    };

    //Other handlers to be added...
}

Back to .Net Grid HowTo topics