why does my combo box display system.Data.DataRowView

Posted on 2012-08-21
Last Modified: 2012-08-21
Hi Everyone,

While creating a wpf application with I ran into a problem where selected item is show as "system.Data.DataRowView" Is there any way I can resolve this issue?

Thank you.

Here is my xaml code

  <ComboBox Grid.Column="1" DisplayMemberPath="Name" SelectedValuePath="UID" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="51,8,0,0" Name="cbWrkStn"  IsEditable="True" VerticalAlignment="Top" Width="175" Grid.RowSpan="2" />

Open in new window

And this is my code
 cbEmp.ItemsSource = dsEmp.Tables(0).DefaultView

Open in new window

Thank you!
Question by:developer2012
    LVL 83

    Accepted Solution

    SelectedItem will be datarowview. You need to either use an index like SelectedItem(0) or use SelectedValue

    Author Closing Comment

    EXcellent answer. Thanks codecruise. :). You are exceptionally awesome
    LVL 83

    Expert Comment

    Glad to help :-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now