Results 1 to 6 of 6

Thread: [RESOLVED] Combobox Databinding Text versus Datasource in WPF

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Location
    Burlington, ON, Canada
    Posts
    343

    Resolved [RESOLVED] Combobox Databinding Text versus Datasource in WPF

    Hi guys,

    As anyone who has read any of my other posts now knows, I'm converting a winforms app to wpf and trying to get the same or similar results of the winforms controls in to my wpf app. As I have been finding each answer or have been assisted by the experts in vbforums I've been posting the results so that hopefully other winforms developers can start making the transition to wpf with real world examples and hurdles that have been overcome. Having said that, here's my next question.

    I have a data entry form in my app that in winforms had a combobox attached to it where you choose a manufacturing customer type from it and can hit a save button. If you scroll through my list of customers, the text displayed in that combobox is actually pulled from the customer table, not the customer_type table. This is accomplished in winforms by setting the datasource property to customer_type_bindingsource, and the Databindings Text property to customer_bindingsource.

    As stated above, the combobox datasource is set to a table in my sql server that has a list of manufacturing types in it. The databinding to the text property of the combobox however, is set to the customer table so the chosen value can be stored there.

    In short, how do i set the itemssource to the customer type table, but the item text displayed to the customer table in either xaml or in codebehind for WPF as i scroll through the customers?
    Last edited by trevorjeaton; Oct 21st, 2010 at 08:23 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width