Ticket T574847
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Incremental filtering in ComboBoxEdit with custom ItemTemplate

ComboBoxEdit in GridControl - How to show values from different properties in DisplayMember

created 7 years ago

[DevExpress Support Team: CLONED FROM T200834: DisplayMember for ComboBoxEdit to display concatenate fields]
Hi, i just download you sample, its great, but in my case i have issues:

Im trying to bind the comboBox itemssource to a list of customer objects (CustomerID, FirstName, LastName, e.t.c.), so i set the value member to CustomerID and i bind the editvalue to CustomerID, now the combobox displays the type from the source which i bound to, which is in my case Customer, so to avoid that i need to set the display member to some column, but then i have nothing from you solution.

Hope i described my issue the best possible, looking forward for a solution.

By the way, can i implement the same thing for the dxg:GridLookUp?

Thank you.

Answers approved by DevExpress Support

created 7 years ago

Hello Joseph,

In this case, you do not need to set the DisplayMember and only use the approach from the previous thread. I've prepared a simple sample to illustrate the main idea of this approach. Please refer to the attachment. Is this what you are looking for?

Thanks,
Andrey

    Comments (2)

      Hi, thanks for your sample.

      Your sample only works because the IsTextEditable property is set to false, but i want it should be true, i want the user should be able to type in for a search, in other words i dont want to change how the items appears in the drop down, i want to change the display member for 2 or more columns.

      Thank you.

      DevExpress Support Team 7 years ago

        Hello,

        Thank you for the detailed description. To achieve this goal, I suggest that you create an additional field in your data source that will contain the required formatted text and show this text in your ItemTemplate. Then, create EditTemplate for your ComboBoxEdit where you will also show the mentioned formatted text with the ability to input new values. Please refer to the Incremental filtering in ComboBoxEdit with custom ItemTemplate thread where this issue has been already discussed. Also, there you can find a small sample illustrating this approach.

        Should you have additional questions, let us know.

        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.