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