Class RadGridViewElement
Represents the element for RadGridView.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.GridView.dll
Syntax
public class RadGridViewElement : GridVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, IRadServiceProvider, IGridViewEventListener
Constructors
RadGridViewElement()
Initializes a new instance of the RadGridViewElement class. Sets up the grid navigator and initializes core functionality for the grid element.
Declaration
public RadGridViewElement()
Properties
ActiveEditor
Gets the active editor
Declaration
public IInputEditor ActiveEditor { get; }
Property Value
|
IInputEditor
|
AutoSizeRows
Gets or sets a value indicating whether row heights will automatically expand to accommodate multiline cell text.
Declaration
public bool AutoSizeRows { get; set; }
Property Value
|
System.Boolean
|
BeginEditMode
Gets or sets a value indicating how the user can initiate cell editing in the grid.
Declaration
public RadGridViewBeginEditMode BeginEditMode { get; set; }
Property Value
|
RadGridViewBeginEditMode
|
ColumnChooser
Gets the current column chooser
Declaration
public GridViewColumnChooser ColumnChooser { get; }
Property Value
|
GridViewColumnChooser
|
ColumnChooserSortOrder
Gets or sets the column chooser sort order.
Declaration
public RadSortOrder ColumnChooserSortOrder { get; set; }
Property Value
|
RadSortOrder
The column chooser sort order. |
ContextMenuManager
Gets an instance of GridViewContextMenuManager or the instance that implements IContextMenuManager interface.
Declaration
public virtual IContextMenuManager ContextMenuManager { get; }
Property Value
|
IContextMenuManager
|
CurrentCell
Gets the currently active cell in the grid view.
Declaration
public GridDataCellElement CurrentCell { get; }
Property Value
|
GridDataCellElement
|
CurrentColumn
Gets or sets the currently selected column in the active grid view.
Declaration
public GridViewColumn CurrentColumn { get; set; }
Property Value
|
GridViewColumn
|
CurrentRow
Gets or sets the currently selected row in the active grid view.
Declaration
public GridViewRowInfo CurrentRow { get; set; }
Property Value
|
GridViewRowInfo
|
CurrentView
Gets or sets the current row view responsible for displaying data in the grid.
Declaration
public IRowView CurrentView { get; set; }
Property Value
|
IRowView
|
EditorManager
Gets an instance of GridViewEditManager that defines how to initialize and create cells and editors.
Declaration
public GridViewEditManager EditorManager { get; set; }
Property Value
|
GridViewEditManager
|
EnableCustomDrawing
Gets or sets a value indicating whether the PaintCell and PaintRow events are enabled.
Declaration
public bool EnableCustomDrawing { get; set; }
Property Value
|
System.Boolean
|
EnterKeyMode
Gets or sets value indicating the behavior when the user presses Enter while adding new row.
Declaration
public RadGridViewEnterKeyMode EnterKeyMode { get; set; }
Property Value
|
RadGridViewEnterKeyMode
|
GridBehavior
Gets or sets an instance of BaseGridBehavior or the instance that implements IGridBehavior interface.
Declaration
public virtual IGridBehavior GridBehavior { get; set; }
Property Value
|
IGridBehavior
|
See Also
GroupExpandAnimationType
Gets or sets the animation effect used when expanding or collapsing grouped rows.
Declaration
public GridExpandAnimationType GroupExpandAnimationType { get; set; }
Property Value
|
GridExpandAnimationType
|
GroupPanelElement
Gets the group panel element used for displaying grouped columns and allowing drag-drop grouping operations.
Declaration
public GroupPanelElement GroupPanelElement { get; }
Property Value
|
GroupPanelElement
|
HideSelection
Gets or sets a value indicating whether the selected item remains highlighted when the control loses focus. When true, selection is hidden when focus is lost; when false, selection remains visible even when the control is not focused.
Declaration
public bool HideSelection { get; set; }
Property Value
|
System.Boolean
|
IsInEditMode
Gets a value indicating whether any cell in the grid is currently in edit mode.
Declaration
public bool IsInEditMode { get; }
Property Value
|
System.Boolean
|
Navigator
NewRowEnterKeyMode
Gets or sets value indicating the behavior when the user presses Enter while adding new row.
Declaration
public RadGridViewNewRowEnterKeyMode NewRowEnterKeyMode { get; set; }
Property Value
|
RadGridViewNewRowEnterKeyMode
|
PagingPanelElement
Gets the paging panel element used for data pagination controls and navigation.
Declaration
public PagingPanelElement PagingPanelElement { get; }
Property Value
|
PagingPanelElement
|
Panel
Gets the main layout panel used to arrange the grid's child elements.
Declaration
public DockLayoutPanel Panel { get; }
Property Value
|
DockLayoutPanel
|
ShowCellErrors
Gets or sets a value indicating whether to show cell errors.
Declaration
public bool ShowCellErrors { get; set; }
Property Value
|
System.Boolean
|
ShowGroupPanel
Gets or sets value indicating whether the GridGroupPanel is visible.
Declaration
public bool ShowGroupPanel { get; set; }
Property Value
|
System.Boolean
|
ShowGroupPanelScrollbars
Gets or sets a value indicating whether the group panel displays scrollbars or expands to show all group headers.
Declaration
public bool ShowGroupPanelScrollbars { get; set; }
Property Value
|
System.Boolean
|
ShowNoDataText
Gets or sets the text to use when there is no data.
Declaration
public bool ShowNoDataText { get; set; }
Property Value
|
System.Boolean
|
ShowRowErrors
Gets or sets a value indicating whether to show row errors.
Declaration
public bool ShowRowErrors { get; set; }
Property Value
|
System.Boolean
|
SplitMode
Gets or sets a value indicating how to split RadGridView.
Declaration
public RadGridViewSplitMode SplitMode { get; set; }
Property Value
|
RadGridViewSplitMode
|
StandardTab
Gets or sets a value indicating whether the TAB key moves the focus to the next control in the tab order rather than moving focus to the next cell in the control.
Declaration
public bool StandardTab { get; set; }
Property Value
|
System.Boolean
|
SynchronizeCurrentRowInSplitMode
Gets or sets whether when changing the current row in one split view the same row in the other split view will be brought into view.
Declaration
public bool SynchronizeCurrentRowInSplitMode { get; set; }
Property Value
|
System.Boolean
|
TableElement
Gets the core table element responsible for rendering the grid data. This is an advanced property intended for internal use or customization scenarios.
Declaration
public GridTableElement TableElement { get; }
Property Value
|
GridTableElement
|
See Also
Template
Gets the master template that defines the structure and behavior of the grid view.
Declaration
public MasterGridViewTemplate Template { get; }
Property Value
|
MasterGridViewTemplate
|
TitleLabelElement
Gets the visual element used to display the grid title.
Declaration
public LightVisualElement TitleLabelElement { get; }
Property Value
|
LightVisualElement
|
TitlePosition
Gets or sets the docking position of the grid title within the control.
Declaration
public Dock TitlePosition { get; set; }
Property Value
|
Dock
|
TitleText
Gets or sets the text displayed in the grid title. When set to null or empty string, the title element will be collapsed.
Declaration
public string TitleText { get; set; }
Property Value
|
System.String
|
UseScrollbarsInHierarchy
Gets or sets a value indicating whether each hierarchical level should display its own dedicated vertical scrollbar.
Declaration
public bool UseScrollbarsInHierarchy { get; set; }
Property Value
|
System.Boolean
|
Methods
ArrangeOverride(SizeF)
Arranges the RadElement to its final location. The element must call the Arrange method of each of its children.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
|
System.Drawing.SizeF
finalSize
The size that is available for element. |
Returns
|
System.Drawing.SizeF
The rectangle occupied by the element. Usually |
Overrides
Remarks
In this method call to the Arrange method of each child must be made.
BeginEdit()
Puts the current cell in edit mode.
Declaration
public bool BeginEdit()
Returns
|
System.Boolean
Returns true if the process is successful. |
CancelEdit()
Close the currently active editor and discard changes.
Declaration
public bool CancelEdit()
Returns
|
System.Boolean
true on successful cancellation. |
CloseEditor()
Ends the edit operation without committing the changes
Declaration
public bool CloseEditor()
Returns
|
System.Boolean
true on success. |
CreateChildElements()
Creates and initializes the child elements of the RadGridViewElement. This method is called during the element's construction process and sets up the internal visual hierarchy.
Declaration
protected override void CreateChildElements()
Overrides
CreateEditorManager()
Returns an instance of GridViewEditManager that defines how to initialize and create cells and editors.
Declaration
protected virtual GridViewEditManager CreateEditorManager()
Returns
|
GridViewEditManager
An instance of GridViewEditManager |
CreateGroupPanelElement()
Creates the group panel element used for column grouping functionality.
Declaration
protected virtual GroupPanelElement CreateGroupPanelElement()
Returns
|
GroupPanelElement
A new instance of the GroupPanelElement class. |
CreatePagingPanelElement()
Creates the paging panel element used for data pagination functionality.
Declaration
protected virtual PagingPanelElement CreatePagingPanelElement()
Returns
|
PagingPanelElement
A new instance of the PagingPanelElement class. |
CreateTemplate()
Creates the template.
Declaration
protected virtual MasterGridViewTemplate CreateTemplate()
Returns
|
MasterGridViewTemplate
A new instance of the MasterGridViewTemplate class. |
DisposeManagedResources()
Disposes all managed resources used by this element, including event handlers, column choosers, and template listeners.
Declaration
protected override void DisposeManagedResources()
Overrides
EndEdit()
Commits any changes and ends the edit operation on the current cell.
Declaration
public bool EndEdit()
Returns
|
System.Boolean
true on success. |
GetDragDropService()
Gets the drag drop service.
Declaration
public RadDragDropService GetDragDropService()
Returns
|
RadDragDropService
|
GetRowView(GridViewInfo)
Gets the row view.
Declaration
public IRowView GetRowView(GridViewInfo viewInfo)
Parameters
|
GridViewInfo
viewInfo
The view info. |
Returns
|
IRowView
|
GetRowViews(GridViewInfo)
Gets the row views.
Declaration
public IEnumerable<IRowView> GetRowViews(GridViewInfo viewInfo)
Parameters
|
GridViewInfo
viewInfo
The view info. |
Returns
|
System.Collections.Generic.IEnumerable<IRowView>
|
GetService<T>()
Retrieves currently registered RadService by the specified type.
Declaration
public T GetService<T>()
where T : RadService
Returns
|
T
|
Type Parameters
|
T
A type derived from RadService |
Implements
HideColumnChooser()
InitializeFields()
Initializes member fields to their default values. This method is called prior the CreateChildItems one and allows for initialization of members on which child elements depend.
Declaration
protected override void InitializeFields()
Overrides
OnBoundsChanged(RadPropertyChangedEventArgs)
Raises the BoundsChanged event.
Declaration
protected override void OnBoundsChanged(RadPropertyChangedEventArgs e)
Parameters
|
RadPropertyChangedEventArgs
e
The RadPropertyChangedEventArgs instance containing the event data. |
Overrides
OnCellFormatting(Object, CellFormattingEventArgs)
Raises the CellFormatting event
Declaration
protected virtual void OnCellFormatting(object sender, CellFormattingEventArgs e)
Parameters
|
System.Object
sender
The cell that needs formatting. |
|
CellFormattingEventArgs
e
A CellFormattingEventArgs instance containing event data. |
See Also
OnCellMerging(GridViewCellMergingEventArgs)
Raises the CellMerging event
Declaration
protected virtual void OnCellMerging(GridViewCellMergingEventArgs e)
Parameters
|
GridViewCellMergingEventArgs
e
A GridViewCellMergingEventArgsinstance containing event data. |
See Also
OnColumnChooserCreated(Object, ColumnChooserCreatedEventArgs)
Called when the column chooser is created.
Declaration
protected virtual void OnColumnChooserCreated(object sender, ColumnChooserCreatedEventArgs e)
Parameters
|
System.Object
sender
The sender. |
|
ColumnChooserCreatedEventArgs
e
The ColumnChooserCreatedEventArgs instance containing the event data. |
OnCreateCell(Object, GridViewCreateCellEventArgs)
Raises the CreateCell event.
Declaration
protected virtual void OnCreateCell(object sender, GridViewCreateCellEventArgs e)
Parameters
|
System.Object
sender
The owner control. |
|
GridViewCreateCellEventArgs
e
An instance of GridViewCreateCellEventArgs containing event data. |
OnCreateRow(Object, GridViewCreateRowEventArgs)
Raises the CreateRow event.
Declaration
protected virtual void OnCreateRow(object sender, GridViewCreateRowEventArgs e)
Parameters
|
System.Object
sender
The owner control. |
|
GridViewCreateRowEventArgs
e
An instance of GridViewCreateRowEventArgs containing event data. |
OnCurrentViewChanged(GridViewCurrentViewChangedEventArgs)
Raises the CurrentViewChanged event
Declaration
protected virtual void OnCurrentViewChanged(GridViewCurrentViewChangedEventArgs e)
Parameters
|
GridViewCurrentViewChangedEventArgs
e
A GridViewCurrentViewChangedEventArgsinstance containing event data. |
OnLoaded()
Called when the element is loaded into the element tree. Initializes binding context and event handlers.
Declaration
protected override void OnLoaded()
Overrides
OnRowFormatting(Object, RowFormattingEventArgs)
Raises the RowFormatting event.
Declaration
protected void OnRowFormatting(object sender, RowFormattingEventArgs e)
Parameters
|
System.Object
sender
The row that needs formatting. |
|
RowFormattingEventArgs
e
A RowFormattingEventArgs instance containing event data. |
See Also
OnUserChangedCurrentRow(Object, EventArgs)
Called when the user manually changes the current row selection.
Declaration
protected virtual void OnUserChangedCurrentRow(object sender, EventArgs e)
Parameters
|
System.Object
sender
The source of the event. |
|
System.EventArgs
e
The System.EventArgs instance containing the event data. |
OnViewCellFormatting(Object, CellFormattingEventArgs)
Raises the ViewCellFormatting event
Declaration
protected virtual void OnViewCellFormatting(object sender, CellFormattingEventArgs e)
Parameters
|
System.Object
sender
The grid cell that needs formatting. |
|
CellFormattingEventArgs
e
A CellFormattingEventArgsinstance containing event data. |
See Also
OnViewRowFormatting(Object, RowFormattingEventArgs)
Raises the ViewRowFormatting event.
Declaration
protected void OnViewRowFormatting(object sender, RowFormattingEventArgs e)
Parameters
|
System.Object
sender
The row that needs formatting. |
|
RowFormattingEventArgs
e
A RowFormattingEventArgs instance containing event data. |
See Also
ProcessTemplatePropertyChangedEvent(GridViewEvent)
Declaration
protected virtual GridViewEventResult ProcessTemplatePropertyChangedEvent(GridViewEvent eventData)
Parameters
|
GridViewEvent
eventData
|
Returns
|
GridViewEventResult
|
ProcessTemplatePropertyChanging(GridViewEvent)
Declaration
protected virtual GridViewEventResult ProcessTemplatePropertyChanging(GridViewEvent eventData)
Parameters
|
GridViewEvent
eventData
|
Returns
|
GridViewEventResult
|
ProcessViewChangedEvent(GridViewEvent)
Processes the view changed event.
Declaration
protected virtual GridViewEventResult ProcessViewChangedEvent(GridViewEvent eventData)
Parameters
|
GridViewEvent
eventData
The event data. |
Returns
|
GridViewEventResult
|
RegisterService(RadService)
Registers the specified service.
Declaration
public void RegisterService(RadService service)
Parameters
|
RadService
service
An instance of type derived from RadService. |
Implements
ShowColumnChooser()
Shows the GridViewColumnChooser for the columns of the master view template.
Declaration
public void ShowColumnChooser()
See Also
ShowColumnChooser(GridViewTemplate)
Shows the GridViewColumnChooser.
Declaration
public void ShowColumnChooser(GridViewTemplate template)
Parameters
|
GridViewTemplate
template
The template which columns will be shown for. |
See Also
Events
CellFormatting
Fires when the content of a data cell needs to be formatted for display.
Declaration
public event CellFormattingEventHandler CellFormatting
Event Type
|
CellFormattingEventHandler
|
See Also
CellMerging
Fires when the two neighbor cells are compared and about to be merged.
Declaration
public event GridViewCellMergingEventHandler CellMerging
Event Type
|
GridViewCellMergingEventHandler
|
See Also
ColumnChooserCreated
Fires when a ColumnChooserCreated is created.
Declaration
public event ColumnChooserCreatedEventHandler ColumnChooserCreated
Event Type
|
ColumnChooserCreatedEventHandler
|
CreateCell
Fires when a cell needs to be created.
Declaration
public event GridViewCreateCellEventHandler CreateCell
Event Type
|
GridViewCreateCellEventHandler
|
CreateRow
Fires when a row needs to be created.
Declaration
public event GridViewCreateRowEventHandler CreateRow
Event Type
|
GridViewCreateRowEventHandler
|
CurrentViewChanged
Fires when the current view in RadGridView has changed.
Declaration
public event GridViewCurrentViewChangedEventHandler CurrentViewChanged
Event Type
|
GridViewCurrentViewChangedEventHandler
|
RowFormatting
Fires when a data row is invalidated and needs to be formatted.
Declaration
public event RowFormattingEventHandler RowFormatting
Event Type
|
RowFormattingEventHandler
|
Examples
void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e)
{
if (e.RowElement.RowInfo.Cells.Count > 0 && (string)e.RowElement.RowInfo.Cells[0].Value == "3")
e.RowElement.Font = strikeoutFont;
else
e.RowElement.Font = SystemFonts.DialogFont;
}
See Also
ViewCellFormatting
Fires when the content of any grid cell needs to be formatted for display.
Declaration
public event CellFormattingEventHandler ViewCellFormatting
Event Type
|
CellFormattingEventHandler
|
See Also
ViewRowFormatting
Fires when a grid row is invalidated and needs to be formatted.
Declaration
public event RowFormattingEventHandler ViewRowFormatting
Event Type
|
RowFormattingEventHandler
|
See Also
Explicit Interface Implementations
IGridViewEventListener.AnalyzeQueue(List<GridViewEvent>)
Declaration
bool IGridViewEventListener.AnalyzeQueue(List<GridViewEvent> events)
Parameters
|
System.Collections.Generic.List<GridViewEvent>
events
|
Returns
|
System.Boolean
|
Implements
IGridViewEventListener.DesiredEvents
Declaration
GridEventType IGridViewEventListener.DesiredEvents { get; }
Returns
|
GridEventType
|
Implements
IGridViewEventListener.DesiredProcessMode
Declaration
GridEventProcessMode IGridViewEventListener.DesiredProcessMode { get; }
Returns
|
GridEventProcessMode
|
Implements
IGridViewEventListener.PostProcessEvent(GridViewEvent)
Declaration
GridViewEventResult IGridViewEventListener.PostProcessEvent(GridViewEvent eventData)
Parameters
|
GridViewEvent
eventData
|
Returns
|
GridViewEventResult
|
Implements
IGridViewEventListener.PreProcessEvent(GridViewEvent)
Declaration
GridViewEventResult IGridViewEventListener.PreProcessEvent(GridViewEvent eventData)
Parameters
|
GridViewEvent
eventData
|
Returns
|
GridViewEventResult
|
Implements
IGridViewEventListener.Priority
Declaration
EventListenerPriority IGridViewEventListener.Priority { get; }
Returns
|
EventListenerPriority
|
Implements
IGridViewEventListener.ProcessEvent(GridViewEvent)
Declaration
GridViewEventResult IGridViewEventListener.ProcessEvent(GridViewEvent eventData)
Parameters
|
GridViewEvent
eventData
|
Returns
|
GridViewEventResult
|