开发者

Simple question, value not being display in DevExpress's LookupComboBox

This is a Delphi project, but I suspect DevExpress's component works similar for Delphi and .NET.

I have a开发者_开发百科 DevExpress GridDBTableView, when selecting a cell in one of the column, I want a LookupComboBox to show up, where user can select an item, and the value gets display in the table cell. Simple.

  • I've set the column's Properties set to 'LookupComboBox'.
  • I have ListColumns setup with 'LocationName' and 'QuantityOnHand'.
  • ListSource is set to a datasource that's linked a dataset of 'LocationID', 'LocationName', and 'QuantityOnhand'.
  • ListFieldNames is set to 'LocationName;QuantityOnHand'

When I click on the cell, the combo box shows up with locations for me to choose, but when I choose a location, the table cell doesn't show the location name. In fact, I can't type anything in the cell.

What am I missing?

Ideally, I would like to be able to select a location from the combo box, the location name shows up in the table cell, and I can somehow store the corresponding LocationID that was selected.


I think that you should also set the column's Properties.KeyFieldName property to the KeyField of the Lookup DataSource. In this case, everything should work properly.


OK, all the answer is in the Express Editors' help file article 'Using Lookup Editors'.

The only step I missed was setting the LookupComboBox's KeyFieldNames property to 'LocationID'.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜