Version

ClickCellButton Event

Occurs when a column is using the Button or EditButton style and the user clicks a cell's button.
Syntax
'Declaration
 
Public Event ClickCellButton As CellEventHandler
public event CellEventHandler ClickCellButton
Event Data

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

PropertyDescription
Cell Returns a reference to the cell of interest.
Remarks

The cell argument returns a reference to an UltraGridCell object that can be used to set properties of, and invoke methods on, the cell whose button was clicked. You can use this reference to access any of the returned cell's properties or methods.

This event is generated when the user clicks a cell's button. A cell may be represented by a button or contain a button, based on its style.

This event is only generated for a cell whose column's Style property is set to 2 (StyleEditButton) or 7 (StyleButton).

Example
Following code shows how one can use ClickCellButton event.

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.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub Button7_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button7.Click

       ' Set the column style to button. Button column style shows buttons in the cells
       ' of the column. When one of them is clicked upon, the UltraGrid will fire ClickCellButton
       ' event giving you a chance to handle it.
       Me.UltraGrid1.DisplayLayout.Bands(0).Columns("CustomerID").Style = ColumnStyle.Button

   End Sub

   Private Sub UltraGrid1_ClickCellButton(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CellEventArgs) Handles ultraGrid1.ClickCellButton

       ' The UltraGrid fires CellClickButton when the user clicks the button in a cell
       ' you a chance to handle it.
       Debug.WriteLine("Button in " & e.Cell.Value.ToString() & " cell was clicked.")

   End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button7_Click(object sender, System.EventArgs e)
{

	// Set the column style to button. Button column style shows buttons in the cells
	// of the column. When one of them is clicked upon, the UltraGrid will fire ClickCellButton
	// event giving you a chance to handle it.
	this.ultraGrid1.DisplayLayout.Bands[0].Columns["CustomerID"].Style = ColumnStyle.Button;

}

private void ultraGrid1_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
{

	// The UltraGrid fires CellClickButton when the user clicks the button in a cell
	// you a chance to handle it.
	Debug.WriteLine( "Button in " + e.Cell.Value.ToString( ) + " cell was clicked." );

}
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