[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1208
  • Last Modified:

why does my combo box display system.Data.DataRowView

Hi Everyone,

While creating a wpf application with vb.net 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 vb.net code
 cbEmp.ItemsSource = dsEmp.Tables(0).DefaultView

Open in new window


Thank you!
0
developer2012
Asked:
developer2012
  • 2
1 Solution
 
CodeCruiserCommented:
SelectedItem will be datarowview. You need to either use an index like SelectedItem(0) or use SelectedValue
0
 
developer2012Author Commented:
EXcellent answer. Thanks codecruise. :). You are exceptionally awesome
0
 
CodeCruiserCommented:
Glad to help :-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now