Sunday 15 June 2014

delphi - How do I display a different value in a TDBComboBox than what is in the database? -


I have my TDBComboBox now just a database field has been tilted in which only one y or Can be N .

I should do it a little bit, and show it like yes or no instead How can I do this?

The solution was for me:

  1. Switch to the form in Design view
  2. Database Value
  3. YesNoCDS
  4. As a TClientDataSet with two fields (yes called noceds)
    • DisplayValue
    • Right-click on and create the Dataset
    • Add data to YesNoCDS in FormShow .
    • Code> Event (It looks like a hip, but I do not see any way to do this in the design view)
    • Create TDATOSOS on a form called Hanoodes and create your DataSet < / Code> YesNoCDS
    • On YesNoCombo, set ListSource on YesNoDS, and then set DisplayValue and KeyField to list fields Database Values ​​

No comments:

Post a Comment