TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sukaskha
NA
113
20.6k
WPF Combobox linking issue
Mar 30 2014 11:43 PM
I have 2 comboboxes and based on selection in 1st one, I want to populate 2nd one. How can I do this with two classes Country and City?
Reply
Answers (
3
)
0
Shweta Lodha
20
48.5k
4.2m
Mar 30 2014 11:52 PM
You can take below approach:
First create Country class that would contain country related information and all available city values in a collection. Somewhere in your code, instantiate a collection of the country and the corresponding cities.
In XAML, bind the ItemSource property of the combobox to that property. For 2nd combobox, bind it's ItemSource property to the list of cities from the SelectedItem of the first combobox.
Hope it will resolve your linking issue.
Accepted Answer
0
Shweta Lodha
20
48.5k
4.2m
Mar 30 2014 11:57 PM
Let me know, in case if you get stuck somewhere.
0
Sukaskha
0
113
20.6k
Mar 30 2014 11:57 PM
Shweta Lodha,
I'll give a try to this approach. Thanks for your suggestion.
WPF browser application
Merging cell