Description:
How can I allow users to edit the value displayed? A user should be able to select an item from the dropdown list and edit it afterwards. I know this is possible with the ComboBox editor, but it does not have a DataSource property to set a DataTable as a list source.
Answer:
The LookUp editor provides users with a list of existing values. You can let users modify the text displayed by setting the TextEditStyle property to standard. However, a new value must be saved to the underlying lookup table, otherwise it is lost; that is, you have to handle the ProcessNewValue event. Please review the following article on this subject:
How to Use the ProcessNewValue Event of a LookUp Editor
It seems that the ComboBox editor is better suited to the task described. The Items collection can be programmatically populated with values from a data table and there is no problem with allowing users to modify the existing values or enter new ones. Please note, however, that the ComboBox saves the displayed values to the underlying data object, unlike the LookUp editor, which saves a representative value (the ValueMember column's value).
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.