Showing posts with label WPF. Show all posts
Showing posts with label WPF. Show all posts

Monday, June 20, 2011

Programatically binding ComboBox in sketchflow to a Collection

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";

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

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,...