DXTabControl.SelectionChanging Event
Occurs before the selected tab item is changed.
Namespace: DevExpress.Xpf.Core
Assembly: DevExpress.Xpf.Core.v14.2.dll
#Declaration
#Event Data
The SelectionChanging event's handler receives an argument of the TabControlSelectionChangingEventArgs type. The following properties provide information specific to this event:
Property | Description |
---|---|
Cancel | Gets or sets whether to cancel selecting the tab item. |
New |
Gets the index of the currently selected tab item.
Inherited from Tab |
New |
Gets a data item that corresponds to the currently selected tab item.
Inherited from Tab |
Old |
Gets the index of the previously selected tab item.
Inherited from Tab |
Old |
Gets a data item that corresponds to the previously selected tab item.
Inherited from Tab |
#Remarks
Handle the SelectionChanging event to prevent selecting a tab item. To do this, set the event parameter's TabControlSelectionChangingEventArgs.Cancel property to true.
To obtain which tab item is being selected, use the DXTabControl.SelectedItem property. Its index is returned by the DXTabControl.SelectedIndex property. The index of the previously selected tab item is returned by the event parameter’s TabControlSelectionChangedEventArgs.OldSelectedIndex property. Use the DXTabControl.GetTabItem method to obtain a tab item by its index.
After a tab item has been selected, the DXTabControl.SelectionChanged event is fired.