为什么LISTFIELD与KEYFIELD设成同一个字段会出现冲突(可见而不可选)?
如何解决?
如我想在其中的DATAFIELD中加入的是LISTFIELD的值而非KEYFIELD的值如何解决?

解决方案 »

  1.   

    当你按下F1时会有如下帮助:
    TDBLookupControl.KeyField
    Identifies the field in the ListSource dataset that must match the value of the DataField field.property KeyField: String;DescriptionUse KeyField to link the ListSource of the lookup control to the DataSource. Although the name of the field specified as the KeyField does not have to be the same as the name of the field specified as the DataField, the two fields must have the same values. 
    //上面的话能看懂就行After specifying the ListField, choose which field the lookup control will actually display with the ListField property.If the DataField field is a lookup field, don't specify anything for KeyField or ListField; lookup controls automatically use the data field's LookupKeyFields property for KeyField.
      

  2.   

    它有这么几个值field       datasource关联的表中的字段,也就是你想与数据库关联的字段KeyField    用来差找的关键字段,
                如果你上面选的ID,
                这里就要选另一个表里的与上一个表中ID关联的字段LISTFIELD   用来显示的字段,後一个表中随便什么字段这样,TDBLookupControl中显示的是LISTFIELD ,其实它的值是KeyField