AdvDBComboBox items problem

At design time, I loaded 4 items into the items list of the component.  Works great.  I save the items to a text file at close, and load the items at the form onshow event.


Now, if I edit the text file to include some new items, they all load into the combo box and display.  If I select one that was added, say item 5 (index of 4), the database stores the selection as a null instead of the correct index.  When I move off the row, the value disappears.

What is the correct method of loading values into the component, so that it is indexed properly and the database field records the index correctly?

Thanks for your insight.

TMS Component pack 8.1.4.0 with Delphi XE7.

Found it.  Sorry for the inconvenience.


For someone looking how to do it, this code works.

  AdvDBComboBoxType.Items.Clear;

  ItemStrings := TStringList.Create;
  ItemStrings.LoadFromFile('JournalTyp.ini');

  for I := 0 to ItemStrings.Count-1 do
    AdvDBComboBoxTyp.AddDisplayAndStoredValue(ItemStrings,inttostr(i));

  ItemStrings.Free;

Thanks for informing the issue was resolved and sharing the solution.