Visual Basic: DataGrid Control
ButtonClick Event (DataGrid Control)
See Also Example Applies To
Occurs when the current cell's built-in button is clicked.
Syntax
Private Subobject_ButtonClick([ indexAs Integer,] ByValcolindex As Integer)
The ButtonClick event syntax has these parts:
Part | Description |
object | An object expression that evaluates to an object in the Applies To list. |
Index | An integer that identifies a control if it is in a control array. |
colindex | An integer that identifies the column whose button was clicked. |
Remarks
The built-in button is enabled for a column when its Button property is set to True.
Typically, you enable the column button when you want to drop down a Visual Basic control (such as the built-in combo box, a bound list box, or even another DataGrid control) for editing or data entry. When the button in the current cell is clicked, the ButtonClick event will be fired. You can then write code to drop down the desired control from the cell.