New to Telerik UI for WinFormsStart a free 30-day trial

Represents a row that enables adding of new rows in RadGridView.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.GridView.dll

Syntax:

C#
public class GridViewNewRowInfo : GridViewSystemRowInfo, IDataItem, IHierarchicalRow, INotifyPropertyChanged, INotifyPropertyChangingEx, IDisposable, IComparable<GridViewSystemRowInfo>

Inheritance: objectGridViewRowInfoGridViewSystemRowInfoGridViewNewRowInfo

Implements: IComparable<GridViewSystemRowInfo>IDataItemIDisposableIHierarchicalRowINotifyPropertyChangedINotifyPropertyChangingEx...

Inherited Members GridViewSystemRowInfo.IsSystemGridViewSystemRowInfo.IndexGridViewSystemRowInfo.RowPositionGridViewSystemRowInfo.ParentGridViewRowInfo.IsAttachedStateGridViewRowInfo.IsModifiedStateGridViewRowInfo.IsCurrentStateGridViewRowInfo.IsSelectedStateGridViewRowInfo.IsExpandedStateGridViewRowInfo.IsVisibleStateGridViewRowInfo.AllowResizeStateGridViewRowInfo.SuspendNotificationsStateGridViewRowInfo.IsInitializedStateGridViewRowInfo.LastRowInfoStateGridViewRowInfo.stateGridViewRowInfo.SetParent(GridViewRowInfo)GridViewRowInfo.GetActualHeight(IGridView)GridViewRowInfo.InvalidateRow()GridViewRowInfo.EnsureVisible()GridViewRowInfo.EnsureVisible(bool)GridViewRowInfo.Delete()GridViewRowInfo.GetErrorText(string)GridViewRowInfo.HasChildRows()GridViewRowInfo.SuspendPropertyNotifications()GridViewRowInfo.ResumePropertyNotifications()GridViewRowInfo.FindParent<T>()GridViewRowInfo.Dispose()GridViewRowInfo.DispatchEvent(KnownEvents, GridEventType, GridEventDispatchMode, object, object[])GridViewRowInfo.GetEventInfo(GridPropertyChangedEventArgs, out GridEventDispatchMode)GridViewRowInfo.OnPropertyChanging(PropertyChangingEventArgsEx)GridViewRowInfo.ClearCache()GridViewRowInfo.SetRowStateProperty<T>(string, ref T, T)GridViewRowInfo.SetBooleanProperty(string, int, bool)GridViewRowInfo.ErrorTextGridViewRowInfo.GroupGridViewRowInfo.ViewInfoGridViewRowInfo.ViewTemplateGridViewRowInfo.CellsGridViewRowInfo.TagGridViewRowInfo.MinHeightGridViewRowInfo.MaxHeightGridViewRowInfo.HeightGridViewRowInfo.IsCurrentGridViewRowInfo.IsSelectedGridViewRowInfo.IsExpandedGridViewRowInfo.IsVisibleGridViewRowInfo.IsPinnedGridViewRowInfo.PinPositionGridViewRowInfo.IsOddGridViewRowInfo.AllowResizeGridViewRowInfo.HierarchyLevelGridViewRowInfo.ChildRowsGridViewRowInfo.HasChildViewsGridViewRowInfo.PropertyChangedGridViewRowInfo.PropertyChanging...

Constructors

Initializes a new instance of the GridViewNewRowInfo.

C#
public GridViewNewRowInfo(GridViewInfo gridViewInfo)
Parameters:gridViewInfoGridViewInfo

An instance of GridViewInfo which the current row belongs to.

Properties

Gets the allowed states for this new row, which is limited to only the Current state.

C#
public override AllowedGridViewRowInfoStates AllowedStates { get; }
Property Value:

The Current state only.

Overrides: GridViewRowInfo.AllowedStates

Gets the data-bound object that populated the row. For new rows, this returns the data-bound item of the bound row if one exists, otherwise returns the base implementation.

C#
public override object DataBoundItem { get; }
Property Value:

The data-bound object associated with this row, or null if no data binding exists.

Overrides: GridViewRowInfo.DataBoundItem

Gets the type of the GridRowElement that represents this row in the user interface.

C#
public override Type RowElementType { get; }
Property Value:

The Type of GridNewRowElement.

Overrides: GridViewRowInfo.RowElementType

Methods

Cancels the new row addition process and reverts any changes made during the editing session. This method removes any bound row from the data source and resets the new row to its initial state.

C#
public void CancelAddNewRow()

Compares this new row with another system row to determine their relative ordering. New rows are positioned after table header rows but before filtering rows.

C#
protected override int CompareToSystemRowInfo(GridViewSystemRowInfo row)
Parameters:rowGridViewSystemRowInfo

The GridViewSystemRowInfo to compare with.

Returns:

int

A value indicating the relative order: 1 if this row should come after the specified row, -1 if this row should come before the specified row, or 0 if they are equivalent.

Overrides: GridViewSystemRowInfo.CompareToSystemRowInfo(GridViewSystemRowInfo)

Completes the process of adding a new row to the grid by validating the data, committing changes to the data source, and raising appropriate events.

C#
public GridViewRowInfo EndAddNewRow()
Returns:

GridViewRowInfo

The GridViewRowInfo that was successfully added to the grid, or null if the operation was canceled or failed.

Initializes the new row for user input by setting up default values and preparing the row for editing. This method handles both data-bound and virtual scenarios, creates bound rows when necessary, and raises the DefaultValuesNeeded event to allow setting default values.

C#
public void InitializeNewRow()

Called when the edit operation begins on this new row. Initializes the new row for editing by calling InitializeNewRow() to prepare it for user input.

C#
protected override bool OnBeginEdit()
Returns:

bool

True if the edit operation was successfully started; otherwise, false.

Overrides: GridViewRowInfo.OnBeginEdit()

Called when the edit operation ends on this new row. Attempts to complete the new row addition by calling EndAddNewRow() to commit the changes to the data source.

C#
protected override bool OnEndEdit()
Returns:

bool

True if the new row was successfully added; otherwise, false.

Overrides: GridViewRowInfo.OnEndEdit()

Called when a property value changes on this new row. Handles special logic for current state changes and row position updates, including cleanup of bound rows when the row loses focus.

C#
protected override void OnPropertyChanged(PropertyChangedEventArgs e)
Parameters:ePropertyChangedEventArgs

The PropertyChangedEventArgs containing information about the changed property.

Overrides: GridViewRowInfo.OnPropertyChanged(PropertyChangedEventArgs)