iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
How are you meant to bind to a uxcombobox?
Lets say I have an object "MyObject" which has a property "ItemID" which is a fk to a product table
I currently have the following xaml
<Intersoft:UXComboBox Name="cboType" ItemsSource="{Binding Source={StaticResource ProductSource}, Path=Items}" DisplayMemberPath="ItemDesc" SelectedValuePath="ItemID" SelectedValue="{Binding MyObject.ItemID, Mode=TwoWay}" />
The dropdown list is populated correctly and the binding appears to work from the combobox down to the object. However, when the page loads the value is not changing the combobox. I tried to do a test in code and it looks like setting the selectedvalue does not set the combobox display. Is there another property I am meant to bind to?
Hue
Hue,
Try binding to SelectedItem instead. That should work.
For MVVM pattern sample, you can see the Contacts sample (in Visual Studio 2010 solution) that we shipped in the RC. Open the Edit Contact form, you can find some examples of input controls that bound to the view model.
Hope this helps,Jimmy.
The problem is I'm binding a collection of objects to the combobox but I only want to bind to the ID field. In my example above if I bound to selecteditem I would get a product object back but I only want the itemID. The SelectedValuePath property allows me to make it return itemid in the selectedvalue, but it's only working one way.
Thank you for your response.
The SelectedValue property has a known issue in the RC build which inadvertently has its Binding clear during certain action. This issue has been addressed in the RTM build that we're going to ship in few weeks.
Regards,Jimmy.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname