Version

GalleryToolItemClick Event (UltraToolbarsManager)

Occurs when an item in a gallery drop down or preview is clicked.
Syntax
'Declaration
 
Public Event GalleryToolItemClick As GalleryToolItemEventHandler
public event GalleryToolItemEventHandler GalleryToolItemClick
Event Data

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

PropertyDescription
GalleryTool Gets the gallery tool associated with this event
Group Gets the group to which the item belongs. This will not apply when the ItemLocation is Preview.
Item Gets the item associated with the event
ItemLocation Gets the gallery location of the item.
Example
The sample demonstrates how to handle the GalleryToolItemClick to determine when and item is clicked or selected.

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.UltraWinToolbars

Private Sub UltraToolbarsManager1_GalleryToolItemClick(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.GalleryToolItemEventArgs) Handles UltraToolbarsManager1.GalleryToolItemClick
	' Use the event arguments to construct a message describing the item that was clicked.
	Dim message As String = e.Item.Title & " has been clicked in the " & e.ItemLocation.ToString() & " area. "

	' If the item is selected, include that in the message also. IsSelected will 
	' be true when the ItemStyle of the gallery owning the item is set to StateButton.
	' Otherwise, it will be false.
	If e.Item.IsSelected Then
		message = message & "It is now the selected item."
	End If

	MessageBox.Show(message)
End Sub
using System.Windows.Forms;
using Infragistics.Win.UltraWinToolbars;

private void ultraToolbarsManager1_GalleryToolItemClick( object sender, GalleryToolItemEventArgs e )
{
	// Use the event arguments to construct a message describing the item that was clicked.
	string message = e.Item.Title + " has been clicked in the " + e.ItemLocation.ToString() + " area. ";

	// If the item is selected, include that in the message also. IsSelected will 
	// be true when the ItemStyle of the gallery owning the item is set to StateButton.
	// Otherwise, it will be false.
	if ( e.Item.IsSelected )
		message += "It is now the selected item.";

	MessageBox.Show( message );			
}
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