BaseListBoxControl.ContextButtonClick Event
In This Article
Fires when a context button is clicked.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v24.2.dll
NuGet Package: DevExpress.Win.Navigation
#Declaration
#Event Data
The ContextButtonClick event's data class is ContextItemClickEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Data |
Gets or sets an Object that contains a clicked Context |
Item |
Gets a clicked Context |
Item |
Gets or sets a clicked Context |
Screen |
Returns a Rectangle that contains a Context |
#Remarks
The ContextButtonClick event fires when an end-user clicks any context button (see BaseListBoxControl.ContextButtons). The ContextItemClickEventArgs.Item property allows you to determine the button being clicked.
You can also handle the ContextItem.Click event to respond to a click on a particular button.
#Example
private void listBoxControl_ContextButtonClick(object sender, DevExpress.Utils.ContextItemClickEventArgs e) {
if (e.Item.Name=="Delete") {
var listBoxControl = (DevExpress.XtraEditors.ListBoxControl)sender;
listBoxControl.Items.Remove(e.DataItem);
}
}
See Also