Class GridViewNewRowInfo
Represents a row that enables adding of new rows in RadGridView.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.GridView.dll
Syntax
public class GridViewNewRowInfo : GridViewSystemRowInfo, IDataItem, IHierarchicalRow, INotifyPropertyChanged, INotifyPropertyChangingEx, IDisposable, IComparable<GridViewSystemRowInfo>
Constructors
GridViewNewRowInfo(GridViewInfo)
Initializes a new instance of the GridViewNewRowInfo.
Declaration
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
public override AllowedGridViewRowInfoStates AllowedStates { get; }
Property Value
AllowedGridViewRowInfoStates
The Current state only. |
Overrides
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
public override object DataBoundItem { get; }
Property Value
System.Object
The data-bound object associated with this row, or null if no data binding exists. |
Overrides
RowElementType
Gets the type of the GridRowElement that represents this row in the user interface.
Declaration
public override Type RowElementType { get; }
Property Value
System.Type
The System.Type of GridNewRowElement. |
Overrides
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
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
protected override int CompareToSystemRowInfo(GridViewSystemRowInfo row)
Parameters
GridViewSystemRowInfo
row
The GridViewSystemRowInfo to compare with. |
Returns
System.Int32
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
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
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
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
protected override bool OnBeginEdit()
Returns
System.Boolean
True if the edit operation was successfully started; otherwise, false. |
Overrides
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
protected override bool OnEndEdit()
Returns
System.Boolean
True if the new row was successfully added; otherwise, false. |
Overrides
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
protected override void OnPropertyChanged(PropertyChangedEventArgs e)
Parameters
System.ComponentModel.PropertyChangedEventArgs
e
The System.ComponentModel.PropertyChangedEventArgs containing information about the changed property. |