FlexGrid for WinForms
Cell Buttons
Show AllShow All
Hide AllHide All

Certain types of cells may require sophisticated editors other than text boxes or drop-down lists. For example, if a column contains file names or a color, it should be edited with a dialog box.

In these cases, you should set the ComboList property to an ellipsis ("…"). The control will display a button next to the cell and will fire the CellButtonClick event when the user clicks on it. You can trap the event, show the dialog box, and update the cell' s contents with the user's selection.

If you add a pipe character before the ellipsis, then the user will also be allowed to edit the cell contents by typing into the cell.

By default, the cell buttons display the ellipsis. You can assign pictures to the cell buttons using the CellButtonImage property.

The example below shows how you can use cell buttons to display a color picker dialog box for choosing a color in a column.

To write code in Visual Basic

To write code in C#

This code sets up the column so the user can click a button and select a color from a dialog box. The next step is the code that handles clicks on the cell button:

To write code in Visual Basic

To write code in C#

See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum |  Documentation Feedback