RadPageViewElement
Encapsulates the UI representation of a RadPageView instance. Different view modes are represented by different implementations of this abstract class.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public abstract class RadPageViewElement : RadPageViewElementBase, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementRadPageViewElementBaseRadPageViewElement...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadPageViewElement class.
public RadPageViewElement()
Fields
Identifies the EnsureSelectedItemVisible dependency property.
public static RadProperty EnsureSelectedItemVisibleProperty
Identifies the ItemBorderAndFillOrientation dependency property.
public static RadProperty ItemBorderAndFillOrientationProperty
Identifies the ItemContentOrientation dependency property.
public static RadProperty ItemContentOrientationProperty
Identifies the ItemDragHint dependency property.
public static RadProperty ItemDragHintProperty
Identifies the ItemDragMode dependency property.
public static RadProperty ItemDragModeProperty
Identifies the ItemSizeMode dependency property.
public static RadProperty ItemSizeModeProperty
Identifies the ItemSpacing dependency property.
public static RadProperty ItemSpacingProperty
Identifies the ShowItemCloseButton dependency property.
public static RadProperty ShowItemCloseButtonProperty
Properties
Gets or sets the mouse button that will be used to select page view items.
public MouseButtons ActionMouseButton { get; set; }
Gets the active text editor used for in-place editing of page view items.
public IInputEditor ActiveEditor { get; }
Gets or sets a value indicating whether in-place editing of page view item text is allowed.
[Browsable(false)]
public bool AllowEdit { get; set; }
Gets the element that represents the content area where page controls are displayed.
[Browsable(false)]
public RadPageViewElementBase ContentArea { get; }
Gets or sets the default RadPageViewPage that will be selected when the element is initialized.
public RadPageViewPage DefaultPage { get; set; }
Gets whether the owning control should modify its non-client area for this view; the base implementation disables modification.
protected virtual bool EnableNCModification { get; }
Gets whether the owning control should invoke non-client painting for this view; the base implementation disables it.
protected virtual bool EnableNCPainting { get; }
Gets or sets a value indicating whether a peek pop-up window can be displayed when a page view item is hovered with the mouse. The content of the peek pop-up must be set in the PeekPopupOpening event.
public virtual bool EnablePeekPopup { get; set; }
Gets or sets a value indicating whether the currently selected item will be automatically scrolled into view.
public bool EnsureSelectedItemVisible { get; set; }
Gets the footer element that can be used to display text or content at the bottom of the page view.
public virtual RadPageViewLabelElement Footer { get; }
Gets the header element that can be used to display text or content at the top of the page view.
public virtual RadPageViewLabelElement Header { get; }
Gets or sets how each page view item's border and fill elements are oriented within this instance.
public PageViewContentOrientation ItemBorderAndFillOrientation { get; set; }
Gets or sets the content orientation for text and images within page view items in this RadPageViewElement instance.
public PageViewContentOrientation ItemContentOrientation { get; set; }
Gets or sets the RadImageShape instance that describes the visual hint indicating where an item will be dropped after a drag operation.
[Browsable(false)]
[VsbBrowsable(true)]
public RadImageShape ItemDragHint { get; set; }
Gets or sets the mode that controls how item drag and drop operations are handled within this element.
public PageViewItemDragMode ItemDragMode { get; set; }
Gets or sets the RadDragDropService instance that handles item drag and drop operations.
[Browsable(false)]
public RadDragDropService ItemDragService { get; set; }
Gets a read-only collection containing all the RadPageViewItem instances currently present within this element.
[Browsable(false)]
public IReadOnlyCollection<RadPageViewItem> Items { get; }
Gets or sets the size that will be applied to page view items when ItemSizeMode is set to EqualSize.
public Size ItemSize { get; set; }
Gets or sets how page view items are sized within this RadPageViewElement instance.
public PageViewItemSizeMode ItemSizeMode { get; set; }
Gets or sets the spacing in pixels between adjacent page view items within this element.
public int ItemSpacing { get; set; }
Gets the RadElement instance that serves as the parent container for all page view items.
protected abstract RadElement ItemsParent { get; }
Gets the RadContextMenu that displays the overflow pages when there are too many items to display.
public RadContextMenu OverflowPagesContextMenu { get; }
Gets the RadPageView instance that owns this element. May be null if this element is hosted on another RadControl instance.
public RadPageView Owner { get; }
Gets the peek pop-up window, which is represented by a RadCallout. The content of the peek pop-up must be set in the PeekPopupOpening event and EnablePeekPopup must be enabled.
public RadCallout PeekPopup { get; }
Gets or sets the time interval in milliseconds required to display a PeekPopup after a RadPageViewItem is hovered.
public int PeekPopupInterval { get; set; }
Gets the timer used to delay the display of the peek pop-up window.
protected Timer PeekTimer { get; }
Gets or sets the currently selected RadPageViewItem in this view.
[Browsable(false)]
public RadPageViewItem SelectedItem { get; set; }
Gets or sets a value indicating whether page selection will wrap around when using arrow keys for navigation. If set to true, pressing the right arrow key when the last page is selected will select the first page.
[Browsable(true)]
public bool SelectionWrap { get; set; }
Gets or sets a value indicating whether a close button will be displayed in each item, allowing the item to be closed.
public bool ShowItemCloseButton { get; set; }
Gets or sets a value indicating whether selecting an item will update the content displayed in the element's ContentArea.
public bool UpdateSelectedItemContent { get; set; }
Methods
Adds the specified RadPageViewItem to this element's items collection.
Performs the core logic for adding an item to the collection.
protected virtual void AddItemCore(RadPageViewItem item)
The item to add.
Deflates the item-layout rectangle by the content-area margin, arranges the content area, and updates the selected page bounds.
protected virtual RectangleF ArrangeContent(RectangleF clientRect)
The rectangle available for the content area.
Returns:The content-area rectangle after applying its margin, or the original rectangle when the content area is collapsed.
Arranges child elements classified as external to the page items and content area over the client rectangle.
protected void ArrangeExternalElements(RectangleF clientRect, SizeF finalSize)
The client rectangle used to arrange external children.
finalSizeSizeFThe final size assigned to the page-view element.
Arranges view-specific page items and returns the rectangle reserved for content. The base implementation returns Empty; derived views provide the content rectangle.
protected virtual RectangleF ArrangeItems(RectangleF itemsRect)
The rectangle available for arranging items.
Returns:A RectangleF representing the available content area.
Arranges external children and the optional header and footer before laying out page items and content.
Puts the currently selected page view item into edit mode for in-place text editing.
public bool BeginEdit()
true if editing was successfully started; otherwise, false.
Allows a drop only when the pointer is over a different item; derived views can further restrict eligible targets.
protected virtual bool CanDropOverItem(RadPageViewItem dragItem, RadPageViewItem hitItem)
The item being dragged.
hitItemRadPageViewItemThe item under the pointer.
Returns:true when the target is eligible.
Determines whether the specified item can have a peek pop-up displayed when EnablePeekPopup is enabled.
protected virtual bool CanPeekItem(RadPageViewItem item)
The RadPageViewItem to check.
Returns:true if a peek pop-up can be displayed for the item; otherwise, false.
Allows selection only for items that are visible and enabled.
protected virtual bool CanSelectItem(RadPageViewItem item)
The item to test.
Returns:true when the item is visible and enabled.
Requests removal of the associated page in a bound view, or removes the item directly when the view is unbound.
protected virtual void CloseItem(RadPageViewItem item)
The item to close.
Creates the child elements that compose this page view element.
protected override void CreateChildElements()
Overrides:
Creates a new RadPageViewItem instance for this element.
Creates the context menu used to list overflow pages. Override this factory to customize the menu.
protected virtual RadContextMenu CreateOverflowPagesContextMenu()
A new context menu.
Displays the item list menu using the specified element as the menu's owner and the specified alignment options.
public void DisplayItemListMenu(RadPageViewElementBase menuOwner, HorizontalPopupAlignment hAlign, VerticalPopupAlignment vAlign)
The element that will own the displayed menu.
hAlignHorizontalPopupAlignmentThe horizontal alignment of the menu relative to the owner.
vAlignVerticalPopupAlignmentThe vertical alignment of the menu relative to the owner.
Displays the item list menu using the specified element as the menu's owner.
public void DisplayItemListMenu(RadPageViewElementBase menuOwner)
The element that will own the displayed menu.
Displays the item list menu using the provided event arguments that contain menu configuration.
protected virtual void DisplayItemListMenu(RadPageViewMenuDisplayingEventArgs e)
The event arguments containing menu display configuration.
Releases the managed resources used by this element.
protected override void DisposeManagedResources()
Overrides:
Commits any changes and ends the edit operation on the current page view item.
public bool EndEdit()
true if the edit operation was successfully ended; otherwise, false.
Provides a hook for derived views to respond when item dragging ends; the base implementation does nothing.
protected virtual void EndItemDrag(RadPageViewItem item)
The item whose drag has ended.
Ensures that the specified RadPageViewItem is visible within the view area.
public bool EnsureItemVisible(RadPageViewItem item)
The item to make visible.
Returns:true if the item was successfully made visible; otherwise, false.
Performs the core logic for ensuring that the specified item is visible.
protected virtual bool EnsureItemVisibleCore(RadPageViewItem item)
The item to make visible.
Returns:true if the item was successfully made visible; otherwise, false.
Finds the RadPageViewItem that contains the specified content element.
public RadPageViewItem FindItem(RadElement content)
The content element to search for.
Returns:The RadPageViewItem containing the content, or null if not found.
Gets the default (automatic) item orientation, which may depend on implementation-specific settings.
protected virtual PageViewContentOrientation GetAutomaticItemOrientation(bool content)
true to retrieve content orientation; false to get orientation for border and fill.
Returns:The automatic PageViewContentOrientation for items.
Calculates the client rectangle for the specified content area element, excluding padding and border thickness.
public virtual Rectangle GetClientRectangleFromContentElement(RadPageViewContentAreaElement contentArea)
The content area element to calculate the client rectangle for.
Returns:A Rectangle representing the usable client area.
Gets the RadPageViewContentAreaElement instance that represents the content area associated with the specified item. By default, this method returns the main content area of the RadPageView control.
public virtual RadPageViewContentAreaElement GetContentAreaForItem(RadPageViewItem item)
The RadPageViewItem for which to get the content area.
Returns:A RadPageViewContentAreaElement instance.
Gets the RadPageViewItem at the specified index.
public RadPageViewItem GetItemAt(int index)
The zero-based index of the item to retrieve.
Returns:The RadPageViewItem at the specified index.
Gets the rectangular area where page view items are displayed within this element.
Returns the padding reserved for the view's non-client area; the base implementation reserves none.
Gets the default direction of the peek-popup arrow; derived views can align it with their item layout.
protected virtual ArrowDirection GetPeekPopupArrowDirection()
The arrow direction, which defaults to Down.
Initializes the default field values for this element.
protected override void InitializeFields()
Overrides:
Inserts the specified RadPageViewItem at the specified index in this element's items collection.
public void InsertItem(int index, RadPageViewItem item)
The zero-based index at which to insert the item.
itemRadPageViewItemThe item to insert.
Performs the core logic for inserting an item at the specified index.
protected virtual void InsertItemCore(int index, RadPageViewItem item)
The zero-based index at which to insert the item.
itemRadPageViewItemThe item to insert.
Determines whether a child is laid out separately from the header, footer, content area, and page-view elements.
protected virtual bool IsChildElementExternal(RadElement element)
The child element to classify.
Returns:true when the child is treated as external.
Gets the RadPageViewItem that contains the specified point in client coordinates.
public RadPageViewItem ItemFromPoint(Point client)
The point in client coordinates to test.
Returns:The RadPageViewItem containing the point, or null if no item contains the point.
Measures child elements classified as external to the page items and content area.
Provides the view-specific measurement of page items and content; the base implementation uses the full available size.
Measures external children, the optional header and footer, and the view-specific item and content areas.
Updates the selected page's bounds when the content bounds change outside an active arrange operation.
protected virtual void OnContentBoundsChanged()
Raises EditorInitialized after the in-place item editor is initialized.
protected virtual void OnEditorInitialized(object sender, RadPageViewEditorEventArgs e)
The object that raised the notification.
eRadPageViewEditorEventArgsThe editor event data.
Raises ItemClicked for the clicked item.
protected virtual void OnItemClick(RadPageViewItem sender, EventArgs e)
The item that was clicked.
eEventArgsThe event data.
Provides a post-change hook for derived views after an item's content has been replaced.
protected virtual void OnItemContentChanged(RadPageViewItem item)
The item whose content changed.
Lets the view approve or veto an item's proposed content replacement before it is applied.
protected virtual bool OnItemContentChanging(RadPageViewItem item, RadElement newContent)
The item whose content is changing.
newContentRadElementThe proposed content element.
Returns:true to allow the replacement; the base implementation always returns true.
Raises ItemCreating and returns the item supplied through the event arguments.
protected virtual RadPageViewItem OnItemCreating(RadPageViewItemCreatingEventArgs args)
The page and item data used by the creation event.
Returns:The item supplied by the event handler, or null when no replacement was supplied.
Starts an item drag outside design mode when item dragging is enabled.
protected virtual void OnItemDrag(RadPageViewItem sender, MouseEventArgs e)
The item being dragged.
eMouseEventArgsThe mouse event data that initiated the drag.
Raises ItemDropped after the drop-processing path completes.
protected virtual void OnItemDropped(object sender, RadPageViewItemDroppedEventArgs args)
The object that raised the notification.
argsRadPageViewItemDroppedEventArgsThe dropped-item data.
Raises the cancellable ItemDropping event before an item is dropped.
protected virtual void OnItemDropping(object sender, RadPageViewItemDroppingEventArgs args)
The object that raised the notification.
argsRadPageViewItemDroppingEventArgsThe proposed drop data.
Selects an unselected item on a single configured action-button press, or prepares an already selected item for editing.
protected virtual void OnItemMouseDown(RadPageViewItem sender, MouseEventArgs e)
The item receiving the mouse input.
eMouseEventArgsThe mouse event data.
Schedules a peek popup for an eligible item, or updates an already visible popup.
protected virtual void OnItemMouseEnter(RadPageViewItem item)
The item the pointer entered.
Stops the peek timer and clears the pending peek item when the pointer leaves an item.
protected virtual void OnItemMouseLeave(RadPageViewItem item)
The item the pointer left.
Begins editing after an eligible mouse-down only when the pointer is released over the same item.
protected virtual void OnItemMouseUp(RadPageViewItem sender, MouseEventArgs e)
The item receiving the mouse-up.
eMouseEventArgsThe mouse event data.
Refreshes the selected item's header and footer when its text, title, or description changes.
protected virtual void OnItemPropertyChanged(RadPageViewItem item, RadPropertyChangedEventArgs e)
The item whose property changed.
eRadPropertyChangedEventArgsThe property-change event data.
Raises ItemsChanged after the item collection changes.
protected virtual void OnItemsChanged(object sender, RadPageViewItemsChangedEventArgs args)
The object that raised the notification.
argsRadPageViewItemsChangedEventArgsThe item and collection operation that occurred.
Raises ItemSelected after an item selection has changed.
public virtual void OnItemSelected(object sender, RadPageViewItemSelectedEventArgs args)
The object that raised the selection notification.
argsRadPageViewItemSelectedEventArgsThe previous and newly selected items.
Raises ItemSelecting before the selected item changes; the event arguments can cancel the change.
public virtual void OnItemSelecting(object sender, RadPageViewItemSelectingEventArgs args)
The object that raised the selection notification.
argsRadPageViewItemSelectingEventArgsThe current and proposed selected items.
Called when the element is loaded and ready for use.
protected override void OnLoaded()
Overrides:
Provides a hook for painting the view's non-client area; the base implementation draws nothing.
protected virtual void OnNCPaint(Graphics g)
The graphics surface used for non-client painting.
Creates an item for the added page, allows ItemCreating to replace it, attaches it to the page, and inserts it into the view.
protected virtual void OnPageAdded(RadPageViewEventArgs e)
The added page and its event data.
Exceptions: ArgumentExceptionThe replacement item supplied by ItemCreating does not inherit from the view's default item type.
Reorders the corresponding item to match the page's new collection index.
protected virtual void OnPageIndexChanged(RadPageViewIndexChangedEventArgs e)
The old and new page indices.
Removes and detaches the item associated with a removed page.
protected virtual void OnPageRemoved(RadPageViewEventArgs e)
The removed page and its event data.
Raises the peek-popup closed event after its callout form closes.
Raises the cancellable peek-popup opening event so handlers can supply popup content.
protected virtual void OnPeekPopupOpening(RadPageViewPeekPopupEventArgs e)
The page, popup, content, and cancellation data.
Refreshes item orientations when orientation properties change and reveals the selected item when that behavior is enabled.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The property-change event data.
Overrides:
Selects the item associated with the newly selected page, or clears selection when no page is selected.
protected virtual void OnSelectedPageChanged(RadPageViewEventArgs e)
The newly selected page, if any.
Arranges the items first, then arranges content in the rectangle left by the item layout.
protected virtual RectangleF PerformArrange(RectangleF clientRect)
The client rectangle available for items and content.
Returns:The rectangle returned by the item layout for content placement.
Raises the cancellable dropping event, requests the page or item reorder when allowed, and then raises the dropped event. In a bound view, the dropped event still follows if a page-index event cancels the reorder.
protected void PerformItemDrop(RadPageViewItem dragItem, RadPageViewItem hitItem)
The item being moved.
hitItemRadPageViewItemThe item used as the drop target.
Resolves the item under the drop location and requests a reorder when both dragged and target items are available.
protected override void ProcessDragDrop(Point dropLocation, ISupportDrag dragObject)
The drop position in control coordinates.
dragObjectISupportDragThe object being dropped.
Overrides:
Resolves and validates the target item first, then brings it into view and checks whether the pointer remains within its updated bounds.
protected override bool ProcessDragOver(Point mousePosition, ISupportDrag dragObject)
The pointer position in control coordinates.
dragObjectISupportDragThe object being dragged.
Returns:true when the pointer is within an allowed target item's bounds.
Overrides:
Handles item navigation and edit commands: the view's next/previous keys, F2, Escape, and Enter for a valid active editor.
protected virtual void ProcessKeyDown(KeyEventArgs e)
The key event data.
Removes the specified RadPageViewItem from this element's items collection.
Performs the core logic for removing an item from the collection.
protected virtual void RemoveItemCore(RadPageViewItem item)
The item to remove.
Selects the next eligible item, wrapping according to SelectionWrap.
public bool SelectNextItem()
true when a candidate index is passed to selection, even if a selecting event later cancels the change; with wrapping enabled, this can be the current item if no eligible alternative exists. Returns false when there is no selected item, fewer than two items, or no candidate index is reached.
Searches from the current item in the requested direction, skipping items that cannot be selected.
protected virtual bool SelectNextItemCore(RadPageViewItem current, bool forward, bool wrap)
The item from which to begin searching.
forwardbooltrue to search toward higher indices; otherwise, search toward lower indices.
wrapbooltrue to continue at the opposite end when the search reaches an end of the collection.
Returns:true when a candidate index is passed to selection, even if a selecting event later cancels the change; with wrapping enabled, this can be the current index if no eligible alternative exists. Returns false when no candidate index is reached.
Selects the previous eligible item, wrapping according to SelectionWrap.
public bool SelectPreviousItem()
true when a candidate index is passed to selection, even if a selecting event later cancels the change; with wrapping enabled, this can be the current item if no eligible alternative exists. Returns false when there is no selected item, fewer than two items, or no candidate index is reached.
Shows the selected page in a bound view, or replaces the content-area child with the item's content in an unbound view.
protected virtual void SetSelectedContent(RadPageViewItem item)
The item whose content should be shown, or null to clear the selection.
Sets the specified RadPageViewItem as the currently selected item.
protected virtual void SetSelectedItem(RadPageViewItem item)
The item to select, or null to clear the selection.
Displays a peek pop-up window over the specified RadPageViewItem. The content of the peek pop-up must be set in the PeekPopupOpening event.
public void ShowPeekPopup(RadPageViewItem peekItem)
The item over which to display the peek pop-up.
Requests popup content through the opening event and shows the callout unless the request is canceled or no content is supplied.
protected virtual void ShowPeekPopupCore(RadPageViewItem peekItem)
The item over which to show the popup.
Starts the view's item-drag service for the specified item.
protected virtual void StartItemDrag(RadPageViewItem item)
The item to drag.
Swaps the positions of two RadPageViewItem instances in the collection.
public void SwapItems(RadPageViewItem item1, RadPageViewItem item2)
The first item to swap.
item2RadPageViewItemThe second item to swap.
Synchronizes the indices of all items in the collection with their visual representation.
protected virtual void SynchronizeItemsIndices()
Reapplies the item's orientation and invalidates the view's measurement.
protected virtual void SyncronizeItem(RadPageViewItem item)
The item to synchronize with the view.
Applies configured or automatically determined content and border/fill orientations to the specified items.
protected virtual void UpdateItemOrientation(IEnumerable items)
The items whose orientations should be updated.
Synchronizes a loaded page's bounds with the page-view content area.
protected virtual void UpdatePageBounds(RadPageViewPage page)
The page whose bounds should be synchronized.
Events
Occurs when an editor for item text editing has been initialized.
public event EventHandler<RadPageViewEditorEventArgs> EditorInitialized
Occurs when a page view item is clicked.
public event EventHandler ItemClicked
Occurs when a new page view item is being created.
public event EventHandler<RadPageViewItemCreatingEventArgs> ItemCreating
Occurs when a page view item has been dropped during a drag operation.
public event EventHandler<RadPageViewItemDroppedEventArgs> ItemDropped
Occurs when a page view item is about to be dropped during a drag operation.
public event EventHandler<RadPageViewItemDroppingEventArgs> ItemDropping
Occurs when the collection of page view items has changed.
public event EventHandler<RadPageViewItemsChangedEventArgs> ItemsChanged
Occurs when a page view item has been selected.
public event EventHandler<RadPageViewItemSelectedEventArgs> ItemSelected
Occurs when a page view item is about to be selected.
public event EventHandler<RadPageViewItemSelectingEventArgs> ItemSelecting
Occurs when the peek pop-up window has been closed.
public event EventHandler PeekPopupClosed
Occurs when the peek pop-up window is about to be displayed. You must populate the content of the peek pop-up in this event handler, otherwise it will not be displayed.
public event EventHandler<RadPageViewPeekPopupEventArgs> PeekPopupOpening