Frequently Asked Component Specific Questions
Options |
|
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>

TAdvDBComboBoxProgrammatically adding items
To add values to a TAdvDBComboBox programmatically, by far the easiest solution is to use the method AdvDBComboBox.AddDisplayAndStoredValue. Example:
AdvDBComboBox1.AddDisplayAndStoredValue('<1000','0');
AdvDBComboBox1.AddDisplayAndStoredValue('>1000 and <10000 ','1');
AdvDBComboBox1.AddDisplayAndStoredValue('>10000 and <50000 ','2');
AdvDBComboBox1.AddDisplayAndStoredValue('>50000 and <100000 ','3');
AdvDBComboBox1.AddDisplayAndStoredValue('>100000 and <500000 ','4');
AdvDBComboBox1.AddDisplayAndStoredValue('>500000 and <1000000 ','5');
AdvDBComboBox1.AddDisplayAndStoredValue('>1000000','6');
Where the first value is what will be displayed in TAdvDBComboBox and the 2nd value what will be stored in the DB field.
To clear items programmatically, you can use:
AdvDBComboBox.Items.Clear;