ComponentOne VSFlexGrid 8.0
CellButtonClick Event

Fired after the user clicks a cell button.

Syntax

Private Sub VSFlexGrid_CellButtonClick( ByVal Row As Long,  ByVal Col As Long)

Remarks

This event is fired when the user clicks an edit button on a cell. Typically, this event is used to pop up a custom editor for the cell (e.g. dialogs for selecting colors, dates, files, pictures, and so on.).

By default, cell edit buttons are displayed on the right side of a cell, with an ellipsis caption ("..."). They are similar to the buttons displayed in the Visual Basic property window next to picture properties. You may customize their appearance by assigning a picture to the CellButtonPicture property.

To create an edit button on a cell, you must set the Editable property to True and set the ComboList (or ColComboList) property to an ellipsis.

For example, the following code assigns edit buttons to the first column of a grid, then traps the CellButtonClick event to show a color-pick dialog and assign the selected color to the cell background:

    Private Sub Form_Load()

        fg.Editable = flexEDKbdMouse

        fg.ColComboList(1) = "..."

    End Sub

    Private Sub fg_CellButtonClick(ByVal Row As Long, ByVal Col As Long)

        CommonDialog1.ShowColor

        fg.Cell(flexcpBackColor, Row, Col) = CommonDialog1.Color

    End Sub

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback