StepProgressBar.ItemClick Event
Occurs when a user clicks an item in the StepProgressBar and allows you to cancel selection.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v25.1.dll
NuGet Package: DevExpress.Win.Navigation
#Declaration
[DXCategory("Action")]
public event EventHandler<StepProgressBarItemClickEventArgs> ItemClick
#Event Data
The ItemClick event's data class is StepProgressBarItemClickEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Handled |
Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing.
Inherited from Handled |
Is |
Gets whether the Step |
Item |
Gets the clicked Step |
Mouse |
Gets an object that contains mouse click event arguments. |
#Remarks
If the StepProgressBar.AllowUserInteraction property is enabled, a user can interact with StepProgressBar items as follows:
- Click items using the mouse to select them.
- Navigate between items using the keyboard and press Enter or Space to click an item.
Use the e.Item event parameter to identify the ‘clicked’ step item. Set the e.Handled
event parameter to true
to cancel selection.
The following code snippet handles the ItemClick
event to prompt the user to save changes. If the user chooses to save, the selected item remains unchanged (the operation is canceled):
stepProgressBar1.AllowUserInteraction = true;
// ...
private void StepProgressBar1_ItemClick(object sender, StepProgressBarItemClickEventArgs e) {
if (IsDataSaved(e.Item)) return;
if (XtraMessageBox.Show("You have unsaved changes. Would you like to save them?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes)
e.Handled = true;
}
The following animation shows the result: