Version

ButtonToolClick Event

Occurs when a button tool within a menu is clicked.
Syntax
'Declaration
 
Public Event ButtonToolClick As ButtonToolClickEventHandler
public event ButtonToolClickEventHandler ButtonToolClick
Event Data

The event handler receives an argument of type ButtonToolClickEventArgs containing data related to this event. The following ButtonToolClickEventArgs properties provide information specific to this event.

PropertyDescription
ColumnFilter Returns the column filter associated with the current filtering operation.
Handled (Inherited from System.ComponentModel.HandledEventArgs) 
Tool Returns the tool that was clicked.
Remarks

This event will fire for all tools that derive from FilterButtonTool, including those buttons that are created automatically for the registered Infragistics.Win.UltraWinGrid.SpecialFilterOperands. Marking this event as handled will prevent the default logic from being executed, which includes applying any filters to the associated column.

Example
The following snippet illustrates how to prevent action from being taken when clicking on a button tool that is associated with a SpecialFilterOperand named "Quarter1", which is shown by default when showing the filter provider on a DateTime column under "Date Filters -> All Dates in the Period"

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Win.SupportDialogs.FilterUIProvider

Private Sub ultraGridFilterUIProvider1_ButtonToolClick(ByVal sender As Object, ByVal e As ButtonToolClickEventArgs) 
    Dim operandTool As FilterOperandTool = TryCast(e.Tool, FilterOperandTool) 
    If operandTool IsNot Nothing AndAlso operandTool.Operand.Name = "Quarter1" Then 
        ' Prevent the operand for "Quarter 1" from doing any filtering and notify the user as such 
        e.Handled = True 
        MessageBox.Show("You don't want Quarter 1; it's colder. Wait for a warmer quarter") 
    End If 
End Sub
using Infragistics.Win.SupportDialogs.FilterUIProvider;

private void ultraGridFilterUIProvider1_ButtonToolClick(object sender, ButtonToolClickEventArgs e)
{
    FilterOperandTool operandTool = e.Tool as FilterOperandTool;
    if (operandTool != null && operandTool.Operand.Name == "Quarter1")
    {
        // Prevent the operand for "Quarter 1" from doing any filtering and notify the user as such
        e.Handled = true;
        MessageBox.Show("You don't want Quarter 1; it's colder.  Wait for a warmer quarter");
    }
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also