Class
GridViewNewRowInfo

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

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.GridView.dll

Syntax:

cs-api-definition
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

GridViewNewRowInfo(GridViewInfo)

Initializes a new instance of the GridViewNewRowInfo.

Declaration

cs-api-definition
public GridViewNewRowInfo(GridViewInfo gridViewInfo)

Parameters

gridViewInfo

GridViewInfo

An instance of GridViewInfo which the current row belongs to.

Properties

AllowedStates

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

Declaration

cs-api-definition
public override AllowedGridViewRowInfoStates AllowedStates { get; }

Property Value

AllowedGridViewRowInfoStates

The Current state only.

Overrides GridViewRowInfo.AllowedStates

DataBoundItem

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.

Declaration

cs-api-definition
public override object DataBoundItem { get; }

Property Value

object

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

Overrides GridViewRowInfo.DataBoundItem

RowElementType

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

Declaration

cs-api-definition
public override Type RowElementType { get; }

Property Value

Type

The Type of GridNewRowElement.

Overrides GridViewRowInfo.RowElementType

Methods

CancelAddNewRow()

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.

Declaration

cs-api-definition
public void CancelAddNewRow()

CompareToSystemRowInfo(GridViewSystemRowInfo)

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.

Declaration

cs-api-definition
protected override int CompareToSystemRowInfo(GridViewSystemRowInfo row)

Parameters

row

GridViewSystemRowInfo

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)

EndAddNewRow()

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.

Declaration

cs-api-definition
public GridViewRowInfo EndAddNewRow()

Returns

GridViewRowInfo

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

InitializeNewRow()

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.

Declaration

cs-api-definition
public void InitializeNewRow()

OnBeginEdit()

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.

Declaration

cs-api-definition
protected override bool OnBeginEdit()

Returns

bool

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

Overrides GridViewRowInfo.OnBeginEdit()

OnEndEdit()

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.

Declaration

cs-api-definition
protected override bool OnEndEdit()

Returns

bool

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

Overrides GridViewRowInfo.OnEndEdit()

OnPropertyChanged(PropertyChangedEventArgs)

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.

Declaration

cs-api-definition
protected override void OnPropertyChanged(PropertyChangedEventArgs e)

Parameters

e

PropertyChangedEventArgs

The PropertyChangedEventArgs containing information about the changed property.

Overrides GridViewRowInfo.OnPropertyChanged(PropertyChangedEventArgs)