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, IImageElement, ITextPrimitive, ITextProvider, IRadServiceProvider, IGridViewEventListener
Constructors
RadGridViewElement()
Properties
ActiveEditor
Gets the active editor
Declaration
public IInputEditor ActiveEditor { get; }
Property Value
IInputEditor
|
AutoSizeRows
Gets or sets a value indicating whether row height in a RataGridView will expand for multiline cell text
Declaration
public bool AutoSizeRows { get; set; }
Property Value
System.Boolean
|
BeginEditMode
Gets or sets value indicating how user begins editing a cell.
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 or the currently active cell in the grid.
Declaration
public GridDataCellElement CurrentCell { get; }
Property Value
GridDataCellElement
|
CurrentColumn
Gets or sets the current column of the currently active view containing the current cell.
Declaration
public GridViewColumn CurrentColumn { get; set; }
Property Value
GridViewColumn
|
CurrentRow
Gets or sets the current row of the currently active view containing the current cell.
Declaration
public GridViewRowInfo CurrentRow { get; set; }
Property Value
GridViewRowInfo
|
CurrentView
Gets or sets the current view.
Declaration
public IRowView CurrentView { get; set; }
Property Value
IRowView
The current view. |
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 set a value indicating the animation effect that will be used when expanding/collapsing groups.
Declaration
public GridExpandAnimationType GroupExpandAnimationType { get; set; }
Property Value
GridExpandAnimationType
|
GroupPanelElement
Gets the group panel element
Declaration
public GroupPanelElement GroupPanelElement { get; }
Property Value
GroupPanelElement
|
HideSelection
Gets or sets a value indicating whether the selected item in the control remains highlighted when the control loses focus.
Returns: true if the selected item does not appear highlighted when the control loses focus; false if the selected item still appears highlighted when the control loses focus. The default is true.
Declaration
public bool HideSelection { get; set; }
Property Value
System.Boolean
|
IsInEditMode
Gets a value indicating whether the cell is 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
Declaration
public PagingPanelElement PagingPanelElement { get; }
Property Value
PagingPanelElement
|
Panel
Gets the panel.
Declaration
public DockLayoutPanel Panel { get; }
Property Value
DockLayoutPanel
The panel. |
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 will show scroll bars or it will expand 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 instance of GridTableElement
Declaration
public GridTableElement TableElement { get; }
Property Value
GridTableElement
|
See Also
Template
Gets the template.
Declaration
public MasterGridViewTemplate Template { get; }
Property Value
MasterGridViewTemplate
The template. |
TitleLabelElement
Gives access to label element used for the title.
Declaration
public LightVisualElement TitleLabelElement { get; }
Property Value
LightVisualElement
|
TitlePosition
Gets or sets a value indicating the position of the title.
Declaration
public Dock TitlePosition { get; set; }
Property Value
Dock
|
TitleText
Gets or set the text of the grid title.
Declaration
public string TitleText { get; set; }
Property Value
System.String
|
UseScrollbarsInHierarchy
Gets or sets a value indicating whether to use dedicated vertical scrollbars in hierarchy.
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()
Called by the element when constructed. Allows inheritors to build the element tree.
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.
Declaration
protected virtual GroupPanelElement CreateGroupPanelElement()
Returns
GroupPanelElement
|
CreatePagingPanelElement()
Creates the paging panel element.
Declaration
protected virtual PagingPanelElement CreatePagingPanelElement()
Returns
PagingPanelElement
|
CreateTemplate()
Creates the template.
Declaration
protected virtual MasterGridViewTemplate CreateTemplate()
Returns
MasterGridViewTemplate
|
DisposeManagedResources()
Disposes all managed resources - such as Bitmaps, GDI+ objects, etc.
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.
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 changed current row.
Declaration
protected virtual void OnUserChangedCurrentRow(object sender, EventArgs e)
Parameters
System.Object
sender
The sender. |
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
|