Documents

NextGrid & NextDBGrid

NextGrid

NextDBGrid

NextInspector

NextSheet

NextCollection

Misc

Labs

NextGrid .NET

NxComboBox styles

Related Articles:

Info
  • Skill:
  • Version: 1.0.1
  • Author: Wim van der Vegt
  • Created:
  • Updated: 2008-04-30
NxComboBox has three new styles placed inside DisplayMode property called dmNameList, dmValueList and dmIdentList.

These three new styles do not allow editing of the text just like the dsDropDownList style.

What makes them different from the dsDropDownList style is that they use the Name=Value feature of TStrings.

Example:

clBlue=Blue
clGreen=Green
clYellow=Yellow


Both dmNameList and dmValueList are ment to implement lookup functionality with an NxComboBox.

Table 1: DisplayMode property
Name Meaning
dmNameList Displays the Names array of Items property.
dmValueList Displays the Values array of the Items property.


Both these lists styles let you retrieve the Name and Value of the chosen item through two new properties called ItemName and ItemValue.



Figure 1: Example of the dmNameList style.



Figure 2: Example of the dmValueList style.

The last new NxComboBox style called dmIdentList expects a numericall Name part of the Name=Value pairs and uses the Name part as Ident level for the NxComboBox Items. The result is that a simple tree-like structure is shown in the DropDownList.

The ItemName returns the IdentLevel of the chosen item and ItemValue returns the chosen item without leading spaces.



Figure 3: Example of the dmIdentList.

Notes:

1. The ItemValue and ItemName are undefined for the dsDropDown and dsDropDownList styles.
2. The results are also undefined for duplicate names just like the behaviour of the TString implementation.

Was This Article Useful?

Comments

2008-04-30 06:54:53

Not working with current version (20.04.2008)

2008-04-30 07:10:08

Hello,

Some things have changed since article have originally posted. We will update it now.

Also, it seems to all work fine. Don't forget that in Items property set something like this

APL=Apple
MS=Microsoft
GO=Google

and then set DisplayMode not Style to dmNameList, dmValueList...

UPDATE: Article updated

Best regards

2008-06-15 12:27:19

This is a helpful article. But the description of the "dmIndentList" wasn't very clear to me at first read, untill I actually tried a little bit myself.

So I guess this article might be more clearer if you could put a little more writing about dmIndentList.

In all, nice work!
Only constructive comments, code contributions... will be publishes. Questions, non-official discussion will not be published.