Occurs when a new Row is added to the grid.
Provides information on the Row of the Grid.

Namespace: Dapfor.Net.Ui
Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)

Syntax

C#
public event EventHandler<GridRowEventArgs> RowAdded
Visual Basic
Public Event RowAdded As EventHandler(Of GridRowEventArgs)
Visual C++
public:
 event EventHandler<GridRowEventArgs^>^ RowAdded {
	void add (EventHandler<GridRowEventArgs^>^ value);
	void remove (EventHandler<GridRowEventArgs^>^ value);
}
F#
member RowAdded : IEvent<EventHandler<GridRowEventArgs>,
    GridRowEventArgs>

Value

Type: System..::..EventHandler<(Of <(<'GridRowEventArgs>)>)>

Examples

 Copy imageCopy
public void InitializeGrid(Grid grid)
{
    grid.RowAdded += delegate(object sender, GridRowEventArgs e)
    {
        Console.WriteLine("The row {0} has been added on the {1} hierarchical level", e.Row.VisibleIndex, e.Row.Level);
    };

    grid.RowMoved += delegate(object sender, GridRowEventArgs e)
    {
        Console.WriteLine("The row has been moved to {0} position", e.Row.VisibleIndex);
    };

    grid.RowRemoving += delegate(object sender, GridRowEventArgs e)
    {
        Console.WriteLine("The row {0} is removing from the grid", e.Row.VisibleIndex);
    };

    grid.RowRemoved += delegate(object sender, GridRowEventArgs e)
    {
        Console.WriteLine("The row has been removed from the grid");
    };

    //Add header and some columns
    grid.Headers.Add(new Header());
    grid.Headers[0].Add(new Column("Price"));
    grid.Headers[0].Add(new Column("Quantity"));
    grid.Headers.Add(new Header());

    //Add 3 row on the top hierarchical level (level 0)
    Row row1 = grid.Rows.Add(new Product());
    Row row2 = grid.Rows.Add(new Product());
    Row row3 =grid.Rows.Add(new Product());
    grid.Rows.ExpandAll();

    //Add a data object on the 1st level as subitem of the row1
    row1.Add(new Product());

    //Add some data objects on the 1st level as subitems of the row2
    row2.Add(new Product());
    row2.Add(new Product());

    //Move the row between row1 and row2. (The grid has only 3 rows on the top level!)
    row3.VisibleChildIndex = 1;

    //Remove child of row2
    grid.Rows.Remove(row2.Children[1]);
}

//Console output:
The row 0 has been added on the 0 hierarchical level
The row 1 has been added on the 0 hierarchical level
The row 2 has been added on the 0 hierarchical level
The row 1 has been added on the 1 hierarchical level
The row 3 has been added on the 1 hierarchical level
The row 4 has been added on the 1 hierarchical level
The row has been moved to 2 position
The row 5 is removing from the grid
The row has been removed from the grid

Thread Safety

This event is always raised in the GUI thread

See Also