ClassMasterGridViewTemplate
Represents the master template for RadGridView that provides the core functionality for data display, hierarchical relationships, selection management, and event synchronization across the entire grid structure.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.GridView.dll
Syntax:
public class MasterGridViewTemplate : GridViewTemplate, IComponent, IDisposable, IDataItemSource, IHierarchicalRow, INotifyPropertyChangingEx, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IGridViewEventListener
Inheritance: objectMarshalByRefObjectComponentGridViewTemplateMasterGridViewTemplate
Implements:
Inherited Members
Constructors
MasterGridViewTemplate()
Initializes a new instance of the MasterGridViewTemplate class.
Declaration
public MasterGridViewTemplate()
Properties
AddNewBoundRowBeforeEdit
Gets or sets a value indicating whether a new bound row should be added to the data source before entering edit mode.
Declaration
[Browsable(false)]
public bool AddNewBoundRowBeforeEdit { get; set; }
Property Value
AutoGenerateHierarchy
Gets or sets a value indicating whether the RadGridView will automatically generate hierarchical relationships from the data source structure when data binding is performed.
Declaration
[Browsable(false)]
public bool AutoGenerateHierarchy { get; set; }
Property Value
CanChangePage
Gets a value that indicates whether the IPagedCollectionView.PageIndex value is allowed to change.
Declaration
public virtual bool CanChangePage { get; }
Property Value
true if the IPagedCollectionView.PageIndex value is allowed to change; otherwise, false.
ClipboardCopyMode
Gets or sets a value that determines whether users can copy cell text values to the clipboard and whether row and column header text is included in the copy operation.
Declaration
[Browsable(false)]
public GridViewClipboardCopyMode ClipboardCopyMode { get; set; }
Property Value
ClipboardCutMode
Gets or sets a value that determines whether users can cut cell text values to the clipboard and whether row and column header text is included in the cut operation.
Declaration
[Browsable(false)]
public GridViewClipboardCutMode ClipboardCutMode { get; set; }
Property Value
ClipboardPasteMode
Gets or sets a value that determines whether users can paste clipboard content into the RadGridView control and how the paste operation is handled.
Declaration
[Browsable(false)]
public GridViewClipboardPasteMode ClipboardPasteMode { get; set; }
Property Value
CurrentRow
Gets or sets the currently active row in the grid. Setting this property triggers current row changed events and updates the current column to match the new row's template if applicable.
Declaration
[Browsable(false)]
public GridViewRowInfo CurrentRow { get; set; }
Property Value
CurrentView
Gets or sets the currently active GridViewInfo that represents the view containing the current row and associated template information.
Declaration
[Browsable(false)]
public GridViewInfo CurrentView { get; set; }
Property Value
EnablePaging
Gets or sets a value indicating whether data pagination is enabled for the current data view, allowing data to be displayed in pages.
Declaration
[Browsable(true)]
public bool EnablePaging { get; set; }
Property Value
EventDispatcher
Gets the EventDispatcher instance responsible for managing and dispatching events within the master template. Creates a new instance if one does not already exist.
Declaration
[Browsable(false)]
public override EventDispatcher EventDispatcher { get; }
Property Value
Overrides
HierarchyDataProvider
Gets or sets the hierarchy data provider for the master template. Only GridViewSelfReferenceDataProvider and GridViewSelfReferenceLoadOnDemandDataProvider types are supported for master templates.
Declaration
[Browsable(false)]
public override GridViewHierarchyDataProvider HierarchyDataProvider { get; set; }
Property Value
Overrides
IsPageChanging
Gets a value that indicates whether a page index change is in process.
Declaration
public virtual bool IsPageChanging { get; }
Property Value
true if the page index is changing; otherwise, false.
MasterTemplate
Gets the root master template. For MasterGridViewTemplate instances, this property returns itself as it represents the top-level template in the hierarchy.
Declaration
[Browsable(false)]
public override MasterGridViewTemplate MasterTemplate { get; }
Property Value
Overrides
MultiSelect
Gets or sets a value indicating whether multiple cells, rows, or columns can be selected simultaneously in the RadGridView. When false, only single selection is allowed.
Owner
Gets the RadGridView control that owns this master template instance.
Declaration
[Browsable(false)]
public RadGridView Owner { get; }
Property Value
PageIndex
Gets the zero-based index of the current page.
Declaration
public virtual int PageIndex { get; }
Property Value
The zero-based index of the current page.
PageSize
Gets or sets the number of items to display on a page.
Declaration
public virtual int PageSize { get; set; }
Property Value
The number of items to display on a page.
PagingBeforeGrouping
Gets or sets a value indicating whether paging is performed before grouping or vice versa.
Declaration
public virtual bool PagingBeforeGrouping { get; set; }
Property Value
true if paging is performed before grouping; otherwise, false.
Relations
Gets the collection of GridViewRelation instances that define the hierarchical structure and parent-child relationships between templates in the grid.
Declaration
[Browsable(false)]
public GridViewRelationCollection Relations { get; }
Property Value
SelectedCells
Gets the collection of GridViewCellInfo instances that represent the cells currently selected by the user across all templates in the grid.
Declaration
[Browsable(false)]
public GridViewSelectedCellsCollection SelectedCells { get; }
Property Value
SelectedRows
Gets the collection of GridViewRowInfo instances that represent the rows currently selected by the user across all templates in the grid.
Declaration
[Browsable(false)]
public GridViewSelectedRowsCollection SelectedRows { get; }
Property Value
SelectionMode
Gets or sets the selection mode that determines how cells, rows, or columns can be selected in the RadGridView.
Declaration
public GridViewSelectionMode SelectionMode { get; set; }
Property Value
SelfReferenceExpanderColumn
Gets or sets the GridViewColumn that will contain the self-reference expander items for hierarchical data display in self-referencing scenarios.
Declaration
[Browsable(true)]
public GridViewColumn SelfReferenceExpanderColumn { get; set; }
Property Value
SynchronizationService
Gets the GridViewSynchronizationService instance that coordinates event dispatch and synchronization across all templates and views within the RadGridView hierarchy.
Declaration
[Browsable(false)]
public GridViewSynchronizationService SynchronizationService { get; }
Property Value
TotalPages
Gets the total number of pages.
VirtualMode
Gets or sets a value indicating whether the grid operates in virtual mode, where data management operations such as sorting, filtering, and grouping are handled by the application rather than the grid control.
Declaration
[Browsable(false)]
public bool VirtualMode { get; set; }
Property Value
Methods
AnalyzeQueueCore(List<GridViewEvent>)
Analyzes a queue of grid view events.
Declaration
protected override bool AnalyzeQueueCore(List<GridViewEvent> events)
Parameters
events
List<GridViewEvent>
The list of events to analyze.
Returns
true if the queue was analyzed successfully; otherwise, false.
Overrides
BeginUpdate()
Suspends event dispatching and begins a batch update operation to improve performance when making multiple changes to the grid.
Declaration
public override void BeginUpdate()
Overrides
ClearSelectedRowsOrCells()
Clears all selected rows and cells from their respective collections in an efficient batch operation.
Declaration
protected virtual void ClearSelectedRowsOrCells()
Copy()
Copies the formatted values of the currently selected cells to the clipboard without removing them from the grid.
Declaration
public virtual void Copy()
CreateBindingContext()
Creates the binding context for the master template. The master template inherits its binding context from the RadGridView control.
Declaration
protected override BindingContext CreateBindingContext()
Returns
Returns null as the master template uses the binding context from its parent RadGridView control.
Overrides
CreateListSource()
Creates and returns a new GridViewListSource instance specifically configured for the master template.
Declaration
protected override GridViewListSource CreateListSource()
Returns
A new GridViewListSource instance associated with this master template.
Overrides
Cut()
Moves the currently selected cells or rows to the clipboard, removing their values from the grid.
Declaration
public virtual void Cut()
Dispose(bool)
Releases the unmanaged resources used by the Component and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Overrides
EndInit()
Completes the initialization of the master template and triggers hierarchy generation if no child templates exist.
Declaration
public override void EndInit()
Overrides
EndUpdate(bool, DataViewChangedEventArgs)
Resumes event dispatching and ends the batch update operation, triggering hierarchy changed events across all templates in the grid.
Declaration
public override void EndUpdate(bool notify, DataViewChangedEventArgs e)
Parameters
notify
Indicates whether to notify listeners of the changes.
e
The data view changed event arguments containing information about the changes.
Overrides
GetClipboardContent()
Retrieves the formatted values that represent the contents of the selected cells for copying to the clipboard without actually placing them on the clipboard.
Declaration
public virtual DataObject GetClipboardContent()
Returns
A DataObject containing the formatted cell values in multiple clipboard formats.
GetClipboardData()
Retrieves and parses clipboard data in multiple formats (HTML, Text, CSV) and returns it as a structured collection of rows and columns.
Declaration
protected virtual List<List<string>> GetClipboardData()
Returns
List<List<string>>
A list of lists representing rows and columns of clipboard data.
GetEventListenerPirotiy()
Gets the event listener priority for the master template, which is set to highest priority to ensure it processes events first.
Declaration
protected override EventListenerPriority GetEventListenerPirotiy()
Returns
The Highest priority level.
Overrides
GetEventProcessMode()
Gets the event processing mode for the master template, enabling all phases of event processing including pre-processing, processing, post-processing, and queue analysis.
Declaration
protected override GridEventProcessMode GetEventProcessMode()
Returns
A combination of GridEventProcessMode flags indicating comprehensive event processing.
Overrides
GetRowsToPasteIn(int)
Gets the collection of existing rows where clipboard data should be pasted, starting from the current row position.
Declaration
protected virtual List<GridViewRowInfo> GetRowsToPasteIn(int numberOfRowsToGet)
Parameters
numberOfRowsToGet
The number of rows to retrieve for pasting.
Returns
List<GridViewRowInfo>
A list of GridViewRowInfo objects representing the target rows for pasting.
MoveToFirstPage()
Sets the first page as the current page.
Declaration
public virtual bool MoveToFirstPage()
Returns
true if the operation was successful; otherwise, false.
MoveToLastPage()
Sets the last page as the current page.
Declaration
public virtual bool MoveToLastPage()
Returns
true if the operation was successful; otherwise, false.
MoveToNextPage()
Moves to the page after the current page.
Declaration
public virtual bool MoveToNextPage()
Returns
true if the operation was successful; otherwise, false.
MoveToPage(int)
Requests a page move to the page at the specified zero-based index.
MoveToPreviousPage()
Moves to the page before the current page.
Declaration
public virtual bool MoveToPreviousPage()
Returns
true if the operation was successful; otherwise, false.
OnNotifyPropertyChanged(PropertyChangedEventArgs)
Handles property change notifications, triggering hierarchy generation when DataSource or DataMember properties change.
Declaration
protected override void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
Parameters
e
The PropertyChangedEventArgs containing information about the changed property.
Overrides
OnPageChanged(object, EventArgs)
Called when the page is changed.
OnPageChanging(object, PageChangingEventArgs)
Called when the page is changing.
Declaration
protected virtual void OnPageChanging(object sender, PageChangingEventArgs e)
Parameters
sender
The sender.
e
The PageChangingEventArgs instance containing the event data.
OnViewChanged(object, DataViewChangedEventArgs)
Handles view change events and performs additional logic such as paging adjustments when the view is reset.
Declaration
protected override void OnViewChanged(object sender, DataViewChangedEventArgs e)
Parameters
sender
The source of the event.
e
The DataViewChangedEventArgs containing information about the view change.
Overrides
Paste()
Pastes the contents from the clipboard into the grid starting at the current cell position, creating new rows if necessary when pasting multiple rows.
Declaration
public virtual void Paste()
PasteDataToNewRow(List<string>)
Pastes the data to new row.
Declaration
protected virtual void PasteDataToNewRow(List<string> rowData)
Parameters
rowData
List<string>
The row data.
PasteDataToRow(List<string>, GridViewRowInfo)
Pastes a row of clipboard data into an existing grid row, performing data type conversion and validation as needed.
Declaration
protected virtual void PasteDataToRow(List<string> rowData, GridViewRowInfo row)
Parameters
rowData
List<string>
The list of string values representing the clipboard row data.
row
The target GridViewRowInfo where the data will be pasted.
PostProcessEventCore(GridViewEvent)
Post-processes grid events, handling row disposal and view change cleanup operations after the main event processing is complete.
Declaration
protected override GridViewEventResult PostProcessEventCore(GridViewEvent eventData)
Parameters
eventData
The GridViewEvent containing event information.
Returns
A GridViewEventResult indicating the post-processing outcome, or null if no special handling is required.
Overrides
PreProcessEventCore(GridViewEvent)
Pre-processes grid events, particularly current row change events, to determine if the event should continue processing or be canceled.
Declaration
protected override GridViewEventResult PreProcessEventCore(GridViewEvent eventData)
Parameters
eventData
The GridViewEvent containing event information.
Returns
A GridViewEventResult indicating whether to continue event processing or cancel it.
Overrides
ProcessEventCore(GridViewEvent)
Processes core grid events including current row changes, template data source initialization, and column collection changes.
Declaration
protected override GridViewEventResult ProcessEventCore(GridViewEvent eventData)
Parameters
eventData
The GridViewEvent containing event information.
Returns
A GridViewEventResult indicating the processing outcome, or null to continue with default processing.
Overrides
Reset()
Resets the master template to its default state by clearing all child templates, relations, columns, and resetting the data source and AutoGenerateHierarchy property.
Declaration
public void Reset()
ResetCurrentRow()
Resets the current row.
Declaration
protected override void ResetCurrentRow()
Overrides
SetPosition(GridViewRowInfo, GridViewColumn, bool)
Sets the current position in the grid by changing the active row and column, with optional validation of the row change.
Declaration
protected bool SetPosition(GridViewRowInfo row, GridViewColumn column, bool validateRowChange)
Parameters
row
The GridViewRowInfo to set as the current row.
column
The GridViewColumn to set as the current column.
validateRowChange
Indicates whether to validate the row change operation.
Returns
True if the position was successfully changed; otherwise, false.
SetPositionCore(GridViewRowInfo, GridViewColumn, GridViewRowInfo, GridViewColumn, bool)
Performs the core logic for setting the current position, including event handling, current row/column changes, and UI updates.
Declaration
protected virtual bool SetPositionCore(GridViewRowInfo newRow, GridViewColumn newColumn, GridViewRowInfo oldRow, GridViewColumn oldColumn, bool validateRowChange)
Parameters
newRow
The new GridViewRowInfo to set as current.
newColumn
The new GridViewColumn to set as current.
oldRow
The previous current row.
oldColumn
The previous current column.
validateRowChange
Indicates whether to validate the row change operation.
Returns
True if the position change was successful; otherwise, false.
UnwireEvents()
Unsubscribes from internal events to prevent memory leaks when the master template is being disposed.
Declaration
protected override void UnwireEvents()
Overrides
WireEvents()
Subscribes to internal events required for the master template functionality, including paging events from the data view.
Declaration
protected override void WireEvents()
Overrides