Combobox selecteditem in Solverlight WCF Ria Services project

I'm using VS2010 and SL4, and have added a comboxBox to my xaml page.

I've used ria services and dragged the source from the datasources list, onto the combobox. When I run the project, the combobox displays the correct list of names.

In code, I need to do two things:

1) Read the selecteditem of the comboxbox - Currently when I read the selecteditem.toString(), I get (tablename - 28(or22)), not the name that is displayed. This should be the name that is displayed in the combobox

2) I need to somehow add the Value to the combobox, as you could in ASP.NET, so I can retrieve the selecteditem,(Name) and the SelectedValue(Instance)

Is this possible?

<ComboBox Canvas.Left="63" Canvas.Top="130" Height="23" x:Name="comboMeters" Width="229" DisplayMemberPath="FriendlyName" ItemsSource="{Binding ElementName=meterListDomainDataSource, Path=Data}" >

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You need to cast the SelectedItem to the type which is represented by the datasource. Then you can get the values.

Check this link

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wint100Author Commented:
in this example

What is the 'Name' property?
wint100Author Commented:
Oops, missed the class at the bottom of the page..

What about if I binding to a domainclass?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.