I don't could find out how to add key values to a dropdownlist (column object) within a grid column. I can use wxGridChoiceEditor to get a dropdownlist like in the following example:
self.addColumn(
dabo.ui.dColumn(self, DataField="C_DESC", Caption="Company",
Sortable=True, Searchable=True, Editable=True, DataType="list",
ListEditorChoices = self.getChoices(self.Application.biz.Companies) ))
def getChoices(self, bizClass):
app = self.Application
bizObj = bizClass(app.dbConnection)
bizObj.requery()
pref = bizObj.KeyField[:1]
choices = ["(select)"]
#keys = {"" : 0}
for co in bizObj.bizIterator():
choices.append("%s" % bizObj.getFieldVal(pref + "_DESC"))
#keys[bizObj.getFieldVal(pref + "_ID")] = len(choices) - 1
return choices
But the 'value' of this column is always the diplayed text/caption of the list items. I would need a key value instead like the in the dabo dDropdownList. Any ideas/hints?