Provides the PropertyGrid's item source, grouping, selection, editing, and visual-update behavior.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class PropertyGridTableElement : VirtualizedScrollPanel<PropertyGridItemBase, PropertyGridItemElementBase>, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, IDataItemSource
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementScrollViewElement<VirtualizedStackContainer<PropertyGridItemBase>>VirtualizedScrollPanel<PropertyGridItemBase, PropertyGridItemElementBase>PropertyGridTableElement...
Implements:
Inherited Members
Constructors
public PropertyGridTableElement()
Fields
Gets or sets the callback invoked when the table creates an item; handlers can supply a replacement through .
public CreatePropertyGridItemEventHandler CreateItem
Gets or sets the callback invoked when the provider chooses a visual element for a PropertyGrid item.
public CreatePropertyGridItemElementEventHandler CreateItemElement
Guards value-changing notifications while an editor is dispatching a value-change callback.
protected bool isChanging
Identifies the ItemHeight property; its metadata default is 24 before DPI scaling.
public static RadProperty ItemHeightProperty
Identifies the ItemIndent property; its metadata default is 20 before DPI scaling.
public static RadProperty ItemIndentProperty
Properties
Gets the active editor.
public IValueEditor ActiveEditor { get; }
Gets or sets a value indicating whether the groups will be expanded or collapse upon creation.
[Browsable(true)]
public bool AutoExpandGroups { get; set; }
Gets or sets a value indicating how user begins editing a cell.
[Browsable(true)]
public RadPropertyGridBeginEditModes BeginEditMode { get; set; }
Gets the collection to which the RadPropertyGrid is bound to.
[Browsable(false)]
public RadCollectionView<PropertyGridItem> CollectionView { get; }
Gets or sets the context menu.
public virtual RadContextMenu ContextMenu { get; set; }
The context menu.
Gets or sets a value indicating whether the data can be grouped programmatically.
[Browsable(true)]
public bool EnableCustomGrouping { get; set; }
Gets or sets a value indicating whether the kinetic scrolling function is enabled.
[Browsable(true)]
public bool EnableKineticScrolling { get; set; }
Gets the filter descriptors.
[Browsable(false)]
public FilterDescriptorCollection FilterDescriptors { get; }
The filter descriptors.
Gets or sets an object that implements IFindStringComparer. The value of this property is used in the keyboard search functionality.
public IFindStringComparer FindStringComparer { get; set; }
Gets the group descriptors.
[Browsable(false)]
public GroupDescriptorCollection GroupDescriptors { get; }
The group descriptors.
Gets the top-level group heading items generated by the current collection view.
public virtual PropertyGridGroupItemCollection Groups { get; }
Gets a value indicating whether there are currently open editors.
[Browsable(false)]
public bool IsEditing { get; }
Gets or sets the height of the items.
[Browsable(true)]
public int ItemHeight { get; set; }
The height of the item.
Gets or sets the width of the indentation of subitems.
[Browsable(true)]
public int ItemIndent { get; set; }
Gets or sets the distance between property grid items.
[Browsable(true)]
public override int ItemSpacing { get; set; }
Overrides:
Gets or sets a value that determines whether the user can navigate to an item by typing when RadPropertyGrid is focused. The default value is false.
public bool KeyboardSearchEnabled { get; set; }
Gets or sets a value that specifies how long the user must wait before searching with the keyboard is reset. The default value is 300.
public int KeyboardSearchResetInterval { get; set; }
Gets the list source that backs the table's property items and collection view.
public RadListSource<PropertyGridItem> ListSource { get; }
Gets or sets the minimum width columns can have.
[Browsable(true)]
public int MinimumColumnWidth { get; set; }
Gets or sets a value that indicates whether editors specified with an EditorAttribute will be used without considering built-in editors.
[Browsable(true)]
public bool OverrideBuiltInEditors { get; set; }
Gets the PropertyGridElement that is a parent to this element.
public PropertyGridElement PropertyGridElement { get; }
Gets the root property items exposed by the current collection view.
public virtual PropertyGridRootItemsCollection PropertyItems { get; }
Gets or sets the mode in which the properties will be displayed in the PropertyGridTableElement.
[Browsable(true)]
public PropertySort PropertySort { get; set; }
Gets or sets a value indicating whether the user is allowed to edit the values of the properties.
[Browsable(true)]
public bool ReadOnly { get; set; }
Gets the ScrollServiceBehavior that is responsible for the kinetic scrolling option.
public ScrollServiceBehavior ScrollBehavior { get; }
Gets the PropertyGridTableElement selected item.
public PropertyGridItemBase SelectedGridItem { get; set; }
Gets or sets the object which properties the RadPropertyGrid is displaying.
[Browsable(false)]
public object SelectedObject { get; set; }
Gets or sets the objects which properties the RadPropertyGrid is displaying.
[Browsable(false)]
public object[] SelectedObjects { get; set; }
Gets the sort descriptors.
[Browsable(false)]
public SortDescriptorCollection SortDescriptors { get; }
The sort descriptors.
Gets or sets the sort order of Nodes.
[Browsable(false)]
public SortOrder SortOrder { get; set; }
The sort order.
Gets or sets a value indicating whether the values of the items should be invalidated the next time a grouping and/or sorting is performed.
[Browsable(false)]
public virtual bool UseCachedValues { get; set; }
Gets or sets the width of the "column" that holds the values.
[Browsable(true)]
public int ValueColumnWidth { get; set; }
Methods
Puts the current item in edit mode.
Begins the update.
public void BeginUpdate()
Uses a mechanism to maximize the visible strings in both columns of RadPropertyGrid.
public void BestFit()
Best fits the column(s) of RadPropertyGrid using the given mode.
public void BestFit(PropertyGridBestFitMode mode)
The mode that determines the mechanism used for best fitting.
Implements the binding-completion callback from IDataItemSource; the table performs no additional action at this point.
public void BindingComplete()
Implements:
Close the currently active editor and discard changes.
public void CancelEdit()
Creates the item collections, list source, traversal services, and smooth-scrolling infrastructure used by the table.
protected override void CreateChildElements()
Overrides:
Creates the provider that supplies visual elements for PropertyGrid items.
protected override IVirtualizedElementProvider<PropertyGridItemBase> CreateElementProvider()
IVirtualizedElementProvider<PropertyGridItemBase>
A provider that creates PropertyGridItemElementBase instances.
Overrides:
Disposes cached editors and owned timers and menus, and releases the table's event subscriptions.
protected override void DisposeManagedResources()
Overrides:
Commits any changes and ends the edit operation on the current item.
Ends the update.
public void EndUpdate()
Ends the update.
public void EndUpdate(bool performUpdate, PropertyGridTableElement.UpdateActions action)
Tells the view whether an update is required or not.
actionPropertyGridTableElement.UpdateActionsIndicates the update action
Ensures the item is visible within the RadPropertygridElement and scrolls the element if needed.
public void EnsureVisible(PropertyGridItemBase item)
The item to visualize.
Ensures the item is visible within the RadPropertygridElement and scrolls the element if needed.
protected virtual void EnsureVisibleCore(PropertyGridItemBase item)
The item to visualize.
Gets an editor depending on the type of the value to be edited.
protected virtual IInputEditor GetEditor(Type editorType)
The type of the value.
Returns:Gets the type of editor used for a editing the given item.
protected virtual Type GetEditorTypeForItem(PropertyGridItem item)
The item to get editor type for.
Returns:The type of the editor
Gets the element at specified coordinates.
public PropertyGridItemElementBase GetElementAt(int x, int y)
The x coordinate.
yintThe y coordinate.
Returns:An instance of PropertyGridItemBase if successful.
Initializes and returns the context menu associated with the specified PropertyGridItemElementBase.
public RadContextMenu GetElementContextMenu(PropertyGridItemElementBase element)
The element.
Returns:An instance of RadContextMenu if successfull.
This method traverses through the visible items of RadPropetyGrid and returns an item matching the searchCriteria.
protected virtual PropertyGridItemBase GetFirstMatch(string searchCriteria, IList<PropertyGridItem> items)
Returns the format matching the image's raw encoding, or Windows Metafile when the encoding is not recognized.
public ImageFormat GetImageFormat(Image image)
The image whose raw format is inspected.
Returns:The matching ImageFormat, or Wmf for an unrecognized format.
Gets the default property for the selected object
protected virtual PropertyGridItem GetSelectedObjectDefaultProperty()
The PropertyGridItem that is the default property.
Refreshes the active PropertyGrid item comparer after the data source initializes.
public void Initialize()
Implements:
Sets the initial column layout, sorting mode, and keyboard-search timer and comparer.
protected override void InitializeFields()
Overrides:
Returns a value indicating whether the PropertyGridItem is editable
protected virtual bool IsItemEditable(PropertyGridItem item)
The item to check.
Returns:True if item can be edited. Otherwise false.
Measures the table and recomputes the value-column width from the available width, item indent, scrollbar, and stored column ratio.
Creates a root PropertyGrid item, allowing OnCreateItem(CreatePropertyGridItemEventArgs) handlers to supply a custom item.
public IDataItem NewItem()
The supplied custom item when it is a PropertyGridItem; otherwise, a new root item.
Implements:
Creates a child item for parentItem, using the item-creation event to allow customization.
public IDataItem NewItem(PropertyGridItem parentItem)
The parent item, or null to create a root item.
Returns:The supplied custom item when it is a PropertyGridItem; otherwise, a new item associated with this table.
Resets item heights for recalculation when automatic item sizing is disabled.
protected override void OnAutoSizeChanged()
Overrides:
Raises the notification before showing the selected item's context menu.
protected virtual void OnContextMenuOpening(PropertyGridContextMenuOpeningEventArgs e)
The selected item, menu, and cancellation state.
Raises the item-creation callback before the table creates an item.
protected virtual void OnCreateItem(CreatePropertyGridItemEventArgs e)
The requested item type, parent, and optional replacement item.
Raises the visual-element creation callback so handlers can select the element type.
protected virtual void OnCreateItemElement(CreatePropertyGridItemElementEventArgs e)
The item and element type selected for creation.
Raises the custom grouping callback used to determine the item's group key.
protected virtual void OnCustomGrouping(PropertyGridCustomGroupingEventArgs e)
The item and custom grouping result.
Raises the edit-completed notification after the active editor has been removed.
protected virtual void OnEdited(PropertyGridItemEditedEventArgs e)
The visual item, editor, and whether the edit was canceled.
Raises the editing notification before the selected editor is initialized.
protected virtual void OnEditing(PropertyGridItemEditingEventArgs e)
The item, proposed editor, and cancellation state.
Raises the notification after the editor has been initialized and before editing begins.
protected virtual void OnEditorInitialized(PropertyGridItemEditorInitializedEventArgs e)
The visual item and initialized editor.
Raises the editor-required notification so handlers can supply an input editor or choose its type.
protected virtual void OnEditorRequired(PropertyGridEditorRequiredEventArgs e)
The item and editor type or instance available for the edit.
Raises the notification after the item's expanded state changes.
protected virtual void OnItemExpandedChanged(RadPropertyGridEventArgs e)
The item whose expanded state changed.
Raises the cancelable notification before an item's expanded state changes.
protected virtual void OnItemExpandedChanging(RadPropertyGridCancelEventArgs e)
The item and cancellation state.
Raises the formatting notification for the specified visual item.
protected virtual void OnItemFormatting(PropertyGridItemFormattingEventArgs e)
The item and visual element being formatted.
Raises the item mouse-click notification.
protected virtual void OnItemMouseClick(RadPropertyGridEventArgs e)
The item that was clicked.
Raises the item mouse-double-click notification.
protected virtual void OnItemMouseDoubleClick(RadPropertyGridEventArgs e)
The item that was double-clicked.
Raises the item mouse-down notification with its original Windows Forms mouse data.
protected virtual void OnItemMouseDown(PropertyGridMouseEventArgs e)
The item and original mouse event.
Raises the item mouse-move notification with its original Windows Forms mouse data.
protected virtual void OnItemMouseMove(PropertyGridMouseEventArgs e)
The item and original mouse event.
Applies a deferred resume update when the table is loaded.
protected override void OnLoaded()
Overrides:
Attempts to end active editing, then scrolls the table for a pan gesture outside the scrollbar, clamping the result to its range.
protected override void OnPanGesture(PanGestureEventArgs args)
The pan location and movement offset; a gesture outside the scrollbar is marked handled even if clamping produces no movement.
Overrides:
Raises BindingContextChanged when the element's binding context changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The changed property and its old and new values.
Overrides:
Raises the notification after validation succeeds and before the editor value is written to the item.
protected virtual void OnPropertyValidated(PropertyValidatedEventArgs e)
The item whose edited value passed validation.
Raises the validation notification before an edited value is committed.
protected virtual void OnPropertyValidating(PropertyValidatingEventArgs e)
The item and proposed value; handlers can cancel the commit.
Raises the notification after an item's accessor has accepted its new value.
protected virtual void OnPropertyValueChanged(PropertyGridItemValueChangedEventArgs e)
The item whose value was written.
Raises the pre-write notification unless the value-change reentrancy guard is set.
protected virtual void OnPropertyValueChanging(PropertyGridItemValueChangingEventArgs e)
The item and proposed and previous values; handlers can cancel a dispatched write.
The dropdown editor sets isChanging while raising its own value-changing event. An item value write during that callback bypasses PropertyValueChanging; the suppression itself does not cancel the write.
Raises the notification after the selected grid item changes.
protected virtual void OnSelectedGridItemChanged(RadPropertyGridEventArgs args)
The item that became selected.
Raises the cancelable notification before changing the selected grid item.
protected virtual void OnSelectedGridItemChanging(RadPropertyGridCancelEventArgs args)
The candidate item and cancellation state.
Raises the notification after the new object or object array is bound and the collection view is refreshed.
protected virtual void OnSelectedObjectChanged(PropertyGridSelectedObjectChangedEventArgs e)
The object or object array now displayed by the grid.
Raises the cancelable notification before changing the displayed object or object array.
protected virtual void OnSelectedObjectChanging(PropertyGridSelectedObjectChangingEventArgs e)
The candidate selection and cancellation state.
Raises the editor's pre-change notification.
protected virtual void OnValueChanging(object sender, ValueChangingEventArgs e)
The editor that is changing its value.
eValueChangingEventArgsThe proposed and previous values; handlers can cancel the editor change.
Performs the needed operations on the data layer when the PropertySort mode is changed.
protected virtual void PerformPropertySort(PropertySort propertySort)
Attempts to show the context menu at a control-client location.
public virtual bool ProcessContextMenu(Point location)
The client point at which the context-menu request occurred.
Returns:true if a menu was shown; otherwise, false when no menu is available, opening is canceled, the point is on a scrollbar or expander, or an active edit cannot be committed.
Processes grid navigation and editing keys, leaving keys to an active non-Boolean editor.
public virtual bool ProcessKeyDown(KeyEventArgs e)
The key-down event data.
Returns:true when F2, Enter, or Space is consumed; otherwise, false.
Forwards the typed character to keyboard search when it is enabled.
protected virtual bool ProcessKeyPress(KeyPressEventArgs e)
The key-press event data.
Returns:false so the control can continue processing the key press.
Provides an overridable mouse-click hook; the base implementation leaves the click unhandled.
public virtual bool ProcessMouseClick(MouseEventArgs e)
The mouse-click event data.
Returns:Routes double-clicks through group-expansion and column-resize handling, then applies the configured second-click behavior to expandable items or leaf editing.
public virtual bool ProcessMouseDoubleClick(MouseEventArgs e)
The mouse double-click event data.
Returns:false so the control can continue processing the double-click.
Processes mouse-down input, attempting to commit an active edit before selecting the item under the pointer; selection processing stops if the edit cannot be committed.
public virtual bool ProcessMouseDown(MouseEventArgs e)
The mouse-down event data.
Returns:true when the attempted selection is canceled or an active edit ends on the already-selected item; otherwise, false.
Updates kinetic scrolling and restores the default cursor when the pointer is over a scrollbar.
public virtual bool ProcessMouseMove(MouseEventArgs e)
The mouse-move event data.
Returns:false so the control can continue processing the mouse move.
Processes mouse-up input and may begin editing when the click matches the configured BeginEditMode.
public virtual bool ProcessMouseUp(MouseEventArgs e)
The mouse-up event data.
Returns:true if the input is consumed because selection was canceled or editing began; otherwise, false.
Scrolls the grid with the mouse wheel unless a non-Boolean item is being edited.
public virtual bool ProcessMouseWheel(MouseEventArgs e)
The mouse-wheel event data.
Returns:false so the control can continue processing the wheel input.
Applies a cancelable item selection, committing any active edit before changing the selection.
protected virtual bool ProcessSelection(PropertyGridItemBase item, bool isMouseSelection)
The item to select.
isMouseSelectionbooltrue when selection was initiated by mouse input; mouse selections are not scrolled into view.
Returns:false if selection is canceled or an active edit cannot be committed; otherwise, true.
Allows you to raise ValueChanged event when using custom editor.
Allows you to raise ValueChanging event when using custom editor.
Makes the property grid columns even.
public void ResetColumnWidths()
Scrolls the scrollbar to bring the specified PropertyGridItemBase into view.
public void ScrollToItem(PropertyGridItemBase item)
The item to visualize.
Sorts the sub items of all expanded items.
public virtual void SortSubItems()
Syncronizes all visual elements.
protected virtual void SynchronizeVisualItems()
Removes the subscriptions established by WireEvents().
protected override void UnwireEvents()
Overrides:
Updates the visual items in the property grid
public void Update(PropertyGridTableElement.UpdateActions updateAction)
Indicated the update action
Updates the scroll bars visibility.
Specifies the action which caused the update.protected virtual void UpdateScrollers(PropertyGridTableElement.UpdateActions updateAction)
Subscribes the table to list, sort, filter, group, and click-timer notifications.
protected override void WireEvents()
Overrides:
Events
Occurs when [binding context changed].
public event EventHandler BindingContextChanged
Implements:
Occurs before an item's context menu is shown; handlers can cancel opening.
public event PropertyGridContextMenuOpeningEventHandler ContextMenuOpening
Fires for custom grouping operation.
Occurs when editing has been finished.
public event PropertyGridItemEditedEventHandler Edited
Occurs when editing is started.
public event PropertyGridItemEditingEventHandler Editing
Occurs when editor is initialized.
public event PropertyGridItemEditorInitializedEventHandler EditorInitialized
Occurs when editor is required.
public event PropertyGridEditorRequiredEventHandler EditorRequired
Occurs when item has been expanded.
public event RadPropertyGridEventHandler ItemExpandedChanged
Occurs when item is expanding.
public event RadPropertyGridCancelEventHandler ItemExpandedChanging
Occurs when PropertyGridItemElement is formatting
public event PropertyGridItemFormattingEventHandler ItemFormatting
Occurs when a mouse button is clicked inside a PropertyGridItemElementBase
public event RadPropertyGridEventHandler ItemMouseClick
Occurs when a mouse button is double clicked inside a PropertyGridItemElementBase
public event RadPropertyGridEventHandler ItemMouseDoubleClick
Occurs when a mouse button is pressed on the PropertyGridItemElement.
public event PropertyGridMouseEventHandler ItemMouseDown
Occurs when mouse moves over a PropertyGridItemElement.
public event PropertyGridMouseEventHandler ItemMouseMove
Fires when a peoperty has finished validating.
public event PropertyValidatedEventHandler PropertyValidated
Fires when a property value is validating.
public event PropertyValidatingEventHandler PropertyValidating
Occurs when item's value has been changed.
public event PropertyGridItemValueChangedEventHandler PropertyValueChanged
Occurs when item's value is changing.
public event PropertyGridItemValueChangingEventHandler PropertyValueChanging
Occurs when selected item has been changed.
public event RadPropertyGridEventHandler SelectedGridItemChanged
Occurs when the selected item is changing
public event RadPropertyGridCancelEventHandler SelectedGridItemChanging
Occurs after the property grid selected object has been changed.
public event PropertyGridSelectedObjectChangedEventHandler SelectedObjectChanged
Occurs before the selected object is changed.
public event PropertyGridSelectedObjectChangingEventHandler SelectedObjectChanging
Fires when the value of an editor changes.
public event EventHandler ValueChanged
Fires before the value in an editor is being changed. The action can be canceled.
public event ValueChangingEventHandler ValueChanging