ComponentOne VSFlexGrid 8.0
Editing Text, Lists, and Combos

Once you set the Editable property to a non-zero value, users may edit text by selecting a cell and then typing into it. This is the most basic type of editing.

Often, the user's choices will be limited to a list of possible values. In these cases, you can let them select the choice from a drop-down list. To do this, build a string containing all the choices separated by pipe characters (e.g., "True|False|Don't know") and assign it to the ColComboList() property of the column for which the choices apply. Each column may have a different list. After this, the grid will display an arrow next to the cell. When the user clicks the arrow or presses a key, the list will drop down and offer the choices available.

A third option is one where there are typical values for a cell, but the user should be allowed to type something else as well. This can be accomplished with drop-down combos, a combination of text box and drop-down list. To create combos, just start the choice list with a pipe character (e.g., "|True|False|Don't know"), then assign it to the ColComboList as before.

In some cases, cells in the same column may need different lists. For example, a property list may show properties on the first column and their values on the second. The values depend on the property, so valid choices change from one row to the next. In these cases, you should trap the BeforeEdit event and set the ComboList property to the appropriate list for the current cell.

 

 


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

Product Support Forum  |  Documentation Feedback