Edit this page

Overview

This topic covers the specific events exposed by the __RadPanelBar__control. The events are grouped by their general purpose.

Click Events

RadPanelBar exposes the following events when a RadPanelBarItem is clicked with the Mouse left button:

  • ItemClick – raised on MouseLeftButtonUp when a RadPanelBarItem is clicked with Mouse left button.

  • ItemDoubleClick – raised on MouseLeftButtonUp when a RadPanelBarItem is double clicked with Mouse left button. The time slot between two clicks must be less than or equal to 300ms in order to be registered as a double click.

RadPanelBarItem exposes the following events:

  • Click – raised on MouseLeftButtonUp when the item is clicked with Mouse left button.

  • DoubleClick – raised on MouseLeftButtonUp when the item is double clicked with Mouse left button. The time slot between the two clicks must be less than or equal to 300ms to register these clicks as a double click.

Click Events sequence.

Currently a successful RadPanelBarItem double click fires the following events:

  • ItemClick event of the RadPanelBar

  • DoubleClick event of the RadPanelBarItem

  • ItemDoubleClick event of the RadPanelBar

  • Click event of the RadPanelBarItem

  • ItemClick event of the RadPanelBar

Selection Events

RadPanelBar exposes the following events regarding the selection:

  • PreviewSelected - occurs before a child item is selected. The PreviewSelected event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A RadRoutedEventArgs object.
  • Selected - occurs when a child RadPanelBarItem has been selected. The Selected event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A RadRoutedEventArgs object.
  • SelectionChanged - occurs after the value of the SelectedItems property of a panel bar is changed. The SelectionChanged event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A SelectionChangedEventArgs object.
  • PreviewUnselected - occurs before a child item is unselected. The PreviewUnselected event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A RadRoutedEventArgs object.
  • Unselected - occurs when a child item has been unselected. The Unselected event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A RadRoutedEventArgs object.

When working with selection the lifecycle of the raised events is:
1. PreviewSelected
2. Selected
3. SelectionChanged
4. PreviewUnselected
5. Unselected

Expand\Collapse Events

RadPanelBar exposes the following events regarding the expanding and collapsing of panelbar items:

  • PreviewExpanded - occurs before a child item is expanded. The PreviewExpanded event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A RadRoutedEventArgs object.
  • Expanded - occurs when a child item has been expanded. The Expanded event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A RadRoutedEventArgs object.
  • PreviewCollapsed - occurs before a child item is collapsed. The PreviewCollapsed event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A RadRoutedEventArgs object.
  • Collapsed - occurs when a child item has been collapsed. The Collapsed event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A RadRoutedEventArgs object.

When expanding and collapsing items the lifecycle of the raised events is:
1. PreviewExpanded
2. Expanded
3. PreviewCollapsed
4. Collapsed

Drag and Drop Events

RadPanelBar exposes the following events regarding the drag and drop:

  • PreviewDragStarted - occurs before the drag is started. The PreviewDragStarted event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A RadPanelBarDragEventArgs object.
  • DragStarted - occurs when the drag has started. The DragStarted event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A RadPanelBarDragEventArgs object.
  • PreviewDragEnded - occurs before the drag has been ended. The PreviewDragEnded event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A RadPanelBarDragEndedEventArgs object.
  • DragEnded - occurs when the drag has ended. The DragEnded event handler receives two arguments:

    • The sender argument contains the RadPanelBar. This argument is of type object, but can be cast to the RadPanelBar type.
    • A RadPanelBarDragEndedEventArgs object.

When working with drag and drop the lifecycle of the raised events is:
1. PreviewDragStarted
2. DragStarted
3. PreviewDragEnded
4. DragEnded

Handling the PreviewDragEnded event will cancel the drop operation. This is useful, when you want to cancel adding/removing items from the RadPanelBar's ItemsCollection.

private void RadPanelBar_PreviewDragEnded(object sender, RadTreeViewDragEndedEventArgs e)
{
    e.Handled = true;
}
Private Sub RadPanelBar_PreviewDragEnded(sender As Object, e As RadTreeViewDragEndedEventArgs)
    e.Handled = True
End Sub
Was this article helpful? Yes No

Give article feedback

Tell us how we can improve this article

Dummy