public Row InsertRow(Row parent, int position, IDictionary <Column, object> initialData = null) { if (parent == null) { throw new ArgumentNullException(nameof(parent)); } if (position < 0 || position > parent.Children.Count) { throw new ArgumentOutOfRangeException(); } var row = new Row { ParentRow = parent }; parent._children.Insert(0, row); //todo unit test data assignment here foreach (var col in Columns) { if (initialData != null && initialData.TryGetValue(col, out var initialValue)) { row.RowValues[col] = initialValue; } else { row.RowValues[col] = col.DefaultValue; } } RowAdded?.Invoke(this, new RowAddedEventArgs(row, position)); return(row); }
///<summary>Raises the RowAdded event.</summary> ///<param name="e">A RowEventArgs object that provides the event data.</param> protected virtual void OnRowAdded(RowListEventArgs e) { EventSequence.Execute(() => RowAdded?.Invoke(this, e)); }
protected virtual void OnRowAdded(EventArgs e) { RowAdded?.Invoke(this, e); }
protected override void OnRowAdded(RowListEventArgs e) { base.OnRowAdded(e); EventSequence.Execute(() => RowAdded?.Invoke(this, new RowListEventArgs <TRow>((TRow)e.Row, e.Index))); }
/// <summary> /// Raise the RowAdded event /// </summary> /// <param name="newRow"></param> protected virtual void OnRowAdded(int newRow) { RowAdded?.Invoke(this, newRow); }
public void OnRowAdded(T t) { State = TableState.Changed; RowAdded?.Invoke(this, new RowEventArgs <T>(t)); }