After a lot of trial and errors, I got the right steps to bind a ComboBox to my collection class. Given below are the steps for anyone out there looking for a solution.
1. Set the ItemsSource property to the collection
2. Set the DataContext property to the collection
3. Set the DisplayMemberPath property to the name of a field in the collection.
4. Set the SelectedValuePath property to the name of a field in the collection.
this.cmbProjects.ItemsSource = Globals.AllProjects.Collection;
this.cmbProjects.DataContext = Globals.AllProjects.Collection;
this.cmbProjects.DisplayMemberPath = "Name";
this.cmbProjects.SelectedValuePath = "Name";
Showing posts with label WPF. Show all posts
Showing posts with label WPF. Show all posts
Monday, June 20, 2011
Monday, February 7, 2011
WPF TreeListView
The MSDN sample below demonstrates how to create a TreeListView in WPF. Sleek!
http://msdn.microsoft.com/en-us/library/ms771523%28v=VS.90%29.aspx
http://msdn.microsoft.com/en-us/library/ms771523%28v=VS.90%29.aspx
Subscribe to:
Posts (Atom)
What is success?
The journey of life takes us through varied experiences like landing an admission at a prestigious college, earning a degree, getting hired,...
-
Recently after a domain password change, I got the following error in trying to run the webrole. Can not log on locally to WebRole as us...
-
In trying to setup a site on a Windows 2008 server, I ran into the following error message Handler "PageHandlerFactory-Integrated"...
-
I was trying my hands at creating a .NET 2.0 component that can be consumed by a COM application. One of the errors I got in the process of...