ClassGridTableElement
Represents the main table element in a grid view that handles displaying rows and columns of data. This element is responsible for rendering the table structure, managing scrolling, and handling row and cell interactions.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.GridView.dll
Syntax:
public class GridTableElement : ScrollViewElement<RowsContainerElement>, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, IRowView, IGridView, IGridViewEventListener
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementScrollViewElement<RowsContainerElement>GridTableElement
Implements:
Inherited Members
Constructors
GridTableElement()
Initializes a new instance of the GridTableElement class.
Declaration
public GridTableElement()
Fields
AlternatingRowColorProperty
Identifies the AlternatingRowColor dependency property.
Declaration
public static RadProperty AlternatingRowColorProperty
Field Value
CellSpacingProperty
Identifies the CellSpacing dependency property.
ChildRowHeightProperty
Identifies the ChildRowHeight dependency property.
Declaration
public static RadProperty ChildRowHeightProperty
Field Value
ColumnDragHintProperty
Identifies the ColumnDragHint dependency property.
Declaration
public static RadProperty ColumnDragHintProperty
Field Value
CurrentRowHeaderImageProperty
Identifies the CurrentRowHeaderImage dependency property.
Declaration
public static RadProperty CurrentRowHeaderImageProperty
Field Value
EditRowHeaderImageProperty
Identifies the EditRowHeaderImage dependency property.
Declaration
public static RadProperty EditRowHeaderImageProperty
Field Value
EnableHotTrackingProperty
Identifies the EnableHotTracking dependency property.
Declaration
public static RadProperty EnableHotTrackingProperty
Field Value
ErrorRowHeaderImageProperty
Identifies the ErrorRowHeaderImage dependency property.
Declaration
public static RadProperty ErrorRowHeaderImageProperty
Field Value
ExtendVerticalScrollBarProperty
Identifies the ExtendVerticalScrollBar dependency property.
Declaration
public static RadProperty ExtendVerticalScrollBarProperty
Field Value
FilterRowHeightProperty
Identifies the FilterRowHeight dependency property.
Declaration
public static RadProperty FilterRowHeightProperty
Field Value
GroupHeaderHeightProperty
Identifies the GroupHeaderHeight dependency property.
Declaration
public static RadProperty GroupHeaderHeightProperty
Field Value
GroupIndentProperty
Identifies the GroupIndent dependency property.
HasColumnHeadersProperty
Identifies the HasColumnHeaders dependency property.
Declaration
public static RadProperty HasColumnHeadersProperty
Field Value
MenuThemeNameProperty
Identifies the MenuThemeName dependency property.
Declaration
public static RadProperty MenuThemeNameProperty
Field Value
NewRowHeaderImageProperty
Identifies the NewRowHeaderImage dependency property.
Declaration
public static RadProperty NewRowHeaderImageProperty
Field Value
RowDragHintProperty
Identifies the RowDragHint dependency property.
RowHeaderColumnWidthProperty
Identifies the RowHeaderColumnWidth dependency property.
Declaration
public static RadProperty RowHeaderColumnWidthProperty
Field Value
RowHeightProperty
Identifies the RowHeight dependency property.
RowSpacingProperty
Identifies the RowSpacing dependency property.
ScrollBarThemeNameProperty
Identifies the ScrollBarThemeName dependency property.
Declaration
public static RadProperty ScrollBarThemeNameProperty
Field Value
SearchHighlightColorProperty
Identifies the SearchHighlightColor dependency property.
Declaration
public static RadProperty SearchHighlightColorProperty
Field Value
SearchRowHeaderImageProperty
Identifies the SearchRowHeaderImage dependency property.
Declaration
public static RadProperty SearchRowHeaderImageProperty
Field Value
SearchRowHeightProperty
Identifies the SearchRowHeight dependency property.
Declaration
public static RadProperty SearchRowHeightProperty
Field Value
SelectColumnWidthProperty
Identifies the SelectColumnWidth dependency property.
Declaration
public static RadProperty SelectColumnWidthProperty
Field Value
ShowSelfReferenceLinesProperty
Identifies the ShowSelfReferenceLines dependency property.
Declaration
public static RadProperty ShowSelfReferenceLinesProperty
Field Value
TableHeaderHeightProperty
Identifies the TableHeaderHeight dependency property.
Declaration
public static RadProperty TableHeaderHeightProperty
Field Value
TreeLevelIndentProperty
Identifies the TreeLevelIndent dependency property.
Declaration
public static RadProperty TreeLevelIndentProperty
Field Value
Properties
AlternatingRowColor
Gets or sets a value indicating the alternating row color for odd rows.
Declaration
public virtual Color AlternatingRowColor { get; set; }
Property Value
CellElementProvider
Gets or sets the cell element provider.
Declaration
public IVirtualizedElementProvider<GridViewColumn> CellElementProvider { get; set; }
Property Value
IVirtualizedElementProvider<GridViewColumn>
The cell element provider.
CellSpacing
Gets or sets the horizontal spacing between adjacent cells in the grid.
ChildRowHeight
Gets or sets the height of child rows in a hierarchical grid structure. The value is automatically scaled according to the current DPI settings.
ChildViews
Gets a collection containing all visible child views
Declaration
public ReadOnlyCollection<IRowView> ChildViews { get; }
Property Value
Implements
ColumnDragHint
Gets or sets the RadImageShape instance which describes the hint that indicates where a column will be dropped after a drag operation.
Declaration
[Browsable(false)]
[VsbBrowsable(true)]
public RadImageShape ColumnDragHint { get; set; }
Property Value
ColumnScroller
Gets the column scroller.
Declaration
public ItemScroller<GridViewColumn> ColumnScroller { get; }
Property Value
The column scroller.
CurrentCell
Gets the current GridCellElement in the GridTableElement.
Declaration
public virtual GridCellElement CurrentCell { get; }
Property Value
Implements
CurrentCellAddress
Gets the address of the current GridCellElement
Declaration
public virtual Point CurrentCellAddress { get; }
Property Value
Implements
CurrentRow
Gets the current GridRowElement in the GridTableElement.
Declaration
public virtual GridRowElement CurrentRow { get; }
Property Value
Implements
CurrentRowHeaderImage
Gets or sets an image for the row header cell of the current GridRowElement.
Declaration
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image CurrentRowHeaderImage { get; set; }
Property Value
EditRowHeaderImage
Gets or sets an image for the row header cell of the GridRowElement indicating it is currently in edit mode.
Declaration
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image EditRowHeaderImage { get; set; }
Property Value
EnableHotTracking
Gets or sets a value indicating whether the hottracking behavior is enabled.
ErrorRowHeaderImage
Gets or sets an image for the row header cell of the GridRowElement with error.
Declaration
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image ErrorRowHeaderImage { get; set; }
Property Value
ExtendVerticalScrollBar
Gets or sets a value indicating whether the vertical scrollbar should be extended to encompass the upper right corner.
FilterRowHeight
Gets or sets the height of the filter row used for column filtering operations. The value is automatically scaled according to the current DPI settings.
GridViewElement
Gets the RadGridViewElement that owns this view.
Declaration
public RadGridViewElement GridViewElement { get; }
Property Value
Implements
GroupHeaderHeight
Gets or sets the height of group header rows in the grid. The value is automatically scaled according to the current DPI settings.
GroupIndent
Gets or sets the width of the GridViewIndentColumn.
IsCurrentView
Gets a value indicating whether the view is current
IsUpdating
Gets a value indicating that the user interface is updating now.
MasterTemplate
Gets the master template.
Declaration
public MasterGridViewTemplate MasterTemplate { get; }
Property Value
The master template.
MenuThemeName
Gets or sets a value indicating the name of the theme for the context menu in the current GridTableElement.
NewRowHeaderImage
Gets or sets an image for the row header cell of the GridNewRowElement.
Declaration
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image NewRowHeaderImage { get; set; }
Property Value
PageViewMode
Gets or sets the page view mode used in child views.The supported modes are: Strip, Stack, Outlook, EplorerBar.
Declaration
public PageViewMode PageViewMode { get; set; }
Property Value
PageViewProvider
Gets or sets the PageViewProvider used in the child views.
Declaration
public IRadPageViewProvider PageViewProvider { get; set; }
Property Value
RowDragHint
Gets or sets the RadImageShape instance which describes the hint that indicates where a row will be dropped after a drag operation.
Declaration
[Browsable(false)]
[VsbBrowsable(true)]
public RadImageShape RowDragHint { get; set; }
Property Value
RowElementProvider
Gets or sets the row element provider.
Declaration
public IVirtualizedElementProvider<GridViewRowInfo> RowElementProvider { get; set; }
Property Value
IVirtualizedElementProvider<GridViewRowInfo>
The row element provider.
RowHeaderColumnWidth
Gets or sets the width of the GridViewRowHeaderColumn.
RowHeight
Gets or sets the height of data rows in the grid table. The value is automatically scaled according to the current DPI settings.
RowScroller
Gets the row scroller.
Declaration
public RowScroller RowScroller { get; }
Property Value
The row scroller.
RowSpacing
Gets or sets the vertical spacing between adjacent rows in the grid.
RowsPerPage
Gets the number of rows displayed to the user.
ScrollBarThemeName
Gets or sets a value indicating the name of the theme for the context menu in the current GridTableElement.
ScrollBehavior
Gets the ScrollServiceBehavior that is responsible for the kinetic scrolling option.
Declaration
public ScrollServiceBehavior ScrollBehavior { get; }
Property Value
SearchHighlightColor
Gets or sets the color that will be used for highlighting search matches in the grid.
Declaration
public virtual Color SearchHighlightColor { get; set; }
Property Value
SearchRowHeaderImage
Gets or sets an image for the row header cell of the GridSearchRowElement.
Declaration
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image SearchRowHeaderImage { get; set; }
Property Value
SearchRowHeight
Gets or sets the height of the search row used for searching within the grid data. The value is automatically scaled according to the current DPI settings.
SelectColumnWidth
Gets or sets the width of the GridViewSelectColumn.
ShowSelfReferenceLines
Gets or sets a value indicating whether to show lines in self reference mode.
SkipVisibilityCheck
Get or set a value indicating whether to skip the control visibility check when ensuring cell/row visibility. If you set it to true, the control will scroll to row/cell even when not visible, when ScrollTo or similar functionality is used.
TableHeaderHeight
Gets or sets the height of the column headers row. The value is automatically scaled according to the current DPI settings.
TreeLevelIndent
Gets or sets the value that determines the indent width among expander primitives in self-reference hierarchy.
ViewInfo
Gets the GridViewInfo that this view represents.
Declaration
public GridViewInfo ViewInfo { get; }
Property Value
Implements
ViewTemplate
Gets the view template.
Declaration
public GridViewTemplate ViewTemplate { get; }
Property Value
The view template.
VisualRows
Gets a RadElementCollection containing the rows currently visible on screen.
Declaration
public virtual IList<GridRowElement> VisualRows { get; }
Property Value
IList<GridRowElement>
Implements
Methods
ArrangeVScrollBar(ref RectangleF, RectangleF, RectangleF)
Arranges the vertical scroll bar.
Declaration
protected override void ArrangeVScrollBar(ref RectangleF viewElementRect, RectangleF hscrollBarRect, RectangleF clientRect)
Parameters
viewElementRect
The view element rect.
hscrollBarRect
The hscroll bar rect.
clientRect
The client rect.
Overrides
BeginUpdate()
Begins batch update of the items.
BestFitColumn(GridViewColumn)
Widens / shrinks a column based on the space required by the text in the columns.
Declaration
public void BestFitColumn(GridViewColumn column)
Parameters
column
The column.
BestFitColumns()
Automatically adjusts the width of all columns based on the content of their cells to ensure optimal fit.
Declaration
public void BestFitColumns()
BestFitColumns(BestFitColumnMode)
Automatically adjusts the width of all columns based on the content of their cells using the specified mode.
Declaration
public void BestFitColumns(BestFitColumnMode mode)
Parameters
mode
The BestFitColumnMode that determines which cells to consider for the calculation.
CreateChildElements()
Creates and initializes the child elements of the grid table. Sets up the row and column scrollers with their respective element providers.
Declaration
protected override void CreateChildElements()
Overrides
Detach()
Detaches the view from its owner.
Declaration
public virtual void Detach()
Implements
DisplayedColumnCount(bool)
Returns the number of columns displayed to the user.
DisplayedRowCount(bool)
Returns the number of rows displayed to the user.
DisposeManagedResources()
Releases all managed resources used by this element, including event handlers, scrollers and internal components.
Declaration
protected override void DisposeManagedResources()
Overrides
DpiScaleChanged(SizeF)
Fires when the DPI scale is changed.
Declaration
public override void DpiScaleChanged(SizeF scaleFactor)
Parameters
scaleFactor
The scale factor.
Overrides
EndUpdate()
Ends batch update of the items.
EndUpdate(bool)
Ends batch update of the items.
EnsureCellVisible(GridViewRowInfo, GridViewColumn)
Ensures that the specified cell is visible.
Declaration
public virtual bool EnsureCellVisible(GridViewRowInfo rowInfo, GridViewColumn column)
Parameters
rowInfo
A GridViewRowInfo that specifies the cell's row
column
A GridViewColumn that specifies the cell's column
Returns
Implements
EnsureRowVisible(GridViewRowInfo)
Ensures that the specified row is visible.
Declaration
public virtual bool EnsureRowVisible(GridViewRowInfo rowInfo)
Parameters
rowInfo
A GridViewRowInfo that specifies the row
Returns
Implements
GetCellElement(GridViewRowInfo, GridViewColumn)
Gets a cell based on corresponding GridViewRowInfo and GridViewColumn
Declaration
public virtual GridCellElement GetCellElement(GridViewRowInfo rowInfo, GridViewColumn column)
Parameters
rowInfo
The corresponding GridViewRowInfo
column
The corresponding GridViewColumn
Returns
An instance to a GridCellElement if successful, null otherwise
Implements
GetRowElement(GridViewRowInfo)
Gets the row's visual element based on the corresponding GridViewRowInfo
Declaration
public virtual GridRowElement GetRowElement(GridViewRowInfo rowInfo)
Parameters
rowInfo
The corresponding GridViewRowInfo
Returns
An instance to a GridRowElement if successful, null otherwise
Implements
Initialize(RadGridViewElement, GridViewInfo)
Initializes the view with an instance of the GridViewTemplate.
Declaration
public virtual void Initialize(RadGridViewElement gridRootElement, GridViewInfo viewInfo)
Parameters
gridRootElement
viewInfo
An instance of GridViewTemplate.
Implements
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
InvalidateCell(GridViewRowInfo, GridViewColumn)
Invalidates a single cell
Declaration
public virtual void InvalidateCell(GridViewRowInfo rowInfo, GridViewColumn column)
Parameters
rowInfo
The corresponding GridViewRowInfo
column
The corresponding GridViewColumn
Implements
InvalidateRow(GridViewRowInfo)
Invalidates a row
Declaration
public virtual void InvalidateRow(GridViewRowInfo rowInfo)
Parameters
rowInfo
The GridViewRowInfo to invalidate
Implements
IsRowVisible(GridViewRowInfo)
Gets a value indicating whether the row is visible
Declaration
public virtual bool IsRowVisible(GridViewRowInfo value)
Parameters
value
The GridViewRowInfo to check for visibility
Returns
Returns true if the row is visible
Implements
MeasureOverride(SizeF)
Measures the size required by the grid table element and its children within the specified available size.
OnLoaded()
Called when the grid table element and all its children have been successfully loaded into the element tree. Sets up event handlers and initializes template-related functionality.
Declaration
protected override void OnLoaded()
Overrides
OnPanGesture(PanGestureEventArgs)
Handles pan gestures for touch-enabled interfaces, allowing scrolling and navigation within the grid.
Declaration
protected override void OnPanGesture(PanGestureEventArgs args)
Parameters
args
The arguments containing information about the pan gesture event.
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Handles property change events by invalidating the fill cache and invoking the base class property change handler.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
Event arguments containing information about the property that changed.
Overrides
ProcessBatchPropertyChanged(Type, PropertyChangedEventArgs)
Declaration
protected virtual GridViewEventResult ProcessBatchPropertyChanged(Type originatorType, PropertyChangedEventArgs propertyChanged)
Parameters
originatorType
propertyChanged
Returns
ProcessColumnEvent(GridViewColumn, GridViewEvent)
Processes the column event.
Declaration
protected virtual GridViewEventResult ProcessColumnEvent(GridViewColumn column, GridViewEvent eventData)
Parameters
column
The column.
eventData
The event data.
Returns
ProcessDragDrop(Point, ISupportDrag)
Processes drag-drop operations performed over this grid table element. Handles dropping of columns and other draggable items onto the grid.
Declaration
protected override void ProcessDragDrop(Point dropLocation, ISupportDrag dragObject)
Parameters
dropLocation
The point where the dragged object was dropped.
dragObject
The object being dragged.
Overrides
ProcessDragOver(Point, ISupportDrag)
Determines whether the grid table element can accept the dragged object at the current mouse location.
Declaration
protected override bool ProcessDragOver(Point currentMouseLocation, ISupportDrag dragObject)
Parameters
currentMouseLocation
The current position of the mouse during dragging.
dragObject
The object being dragged.
Returns
True if the dragged object can be dropped at the current location; otherwise, false.
Overrides
ProcessFilterDescriptorCollectionEvent(GridViewFilterDescriptorCollection, GridViewEvent)
Processes the filter descriptor collection event.
Declaration
protected virtual GridViewEventResult ProcessFilterDescriptorCollectionEvent(GridViewFilterDescriptorCollection filters, GridViewEvent eventData)
Parameters
filters
GridViewFilterDescriptorCollection
The filters.
eventData
The event data.
Returns
ProcessMasterTemplateEvent(GridViewEvent)
Processes the master template event.
Declaration
protected virtual GridViewEventResult ProcessMasterTemplateEvent(GridViewEvent eventData)
Parameters
eventData
The event data.
Returns
ProcessRowEvent(GridViewRowInfo, GridViewEvent)
Processes the row event.
Declaration
protected virtual GridViewEventResult ProcessRowEvent(GridViewRowInfo row, GridViewEvent eventData)
Parameters
row
The row.
eventData
The event data.
Returns
ProcessTemplateEvent(GridViewEvent)
Processes the template event.
Declaration
protected virtual GridViewEventResult ProcessTemplateEvent(GridViewEvent eventData)
Parameters
eventData
The event data.
Returns
ProcessViewInfoEvent(GridViewEvent)
Processes the view info event.
Declaration
protected virtual GridViewEventResult ProcessViewInfoEvent(GridViewEvent eventData)
Parameters
eventData
The event data.
Returns
RemoveStylePropertySetting(IPropertySetting)
Called when element style condition changes. This method is used internally.
Declaration
public override void RemoveStylePropertySetting(IPropertySetting setting)
Parameters
setting
Overrides
ScrollTo(int, int)
Scrolls to the specific cell.
ScrollToColumn(int)
Scrolls to column.
Declaration
public virtual void ScrollToColumn(int columnIndex)
Parameters
columnIndex
Index of the column.
ScrollToRow(GridViewRowInfo)
Scrolls to row.
Declaration
public virtual void ScrollToRow(GridViewRowInfo rowInfo)
Parameters
rowInfo
The row info.
ScrollToRow(int)
Scrolls to row.
UnWireEvents()
Unsubscribes from events that were wired in the WireEvents() method to prevent memory leaks.
Declaration
protected void UnWireEvents()
Update(GridUINotifyAction, params GridViewRowInfo[])
Updates with the specified action.
Declaration
public void Update(GridUINotifyAction action, params GridViewRowInfo[] rowInfos)
Parameters
action
The action.
rowInfos
The row infos.
UpdateColumnsDpiScaleFactor()
Updates the columns DPI scale factor.
Declaration
protected virtual void UpdateColumnsDpiScaleFactor()
UpdateReferences(ComponentThemableElementTree, bool, bool)
Updates the local references using the provided element tree.
Declaration
protected override void UpdateReferences(ComponentThemableElementTree tree, bool updateInheritance, bool recursive)
Parameters
tree
The element tree to use for updating references.
updateInheritance
True to update inheritance chain, false otherwise.
recursive
True to update children also, false otherwise.
Overrides
UpdateView()
Explicitly synchonizes the view with its owner.
Declaration
public virtual void UpdateView()
Implements
WireEvents()
Subscribes to necessary events for proper grid table operation including scrollbar, tooltip, and theme change events.
Declaration
protected void WireEvents()