wpf-tutorials (wpf_tutorials) wrote,
wpf-tutorials
wpf_tutorials

DataTemplate, value converter and ObservableCollection

A couple of days ago, I was working on program that can process the results of students.  I wanted to create a listboxitem for every student that contains a textblock for the name and a textbox to insert or update the result.

After asking advise on different forums and a lot of trying and failing, I finally found a way to get this done.

I use a ObservableCollection for data binding to my listbox.  Use a datatemplate to put different controls in the itemtemplate, and a value converter to indicate if the student is passed or not.

My conclusion: an ObservableCollection is very powerful!

You can download the tutorial and the entire source code:

Tags: data binding, styles and templates
Subscribe

  • Teched Developer 2007: Day 5

    09u: Microsoft Visual Basic: Tips and Tricks for the Microsoft Visual Studio 2008 IDE by Jay Schmelzer Visual Basic is still my favorite .Net…

  • Teched Developer 2007: Day 4

    09u: Using ClickOnce and XBAP to deploy Windows Forms and WPF applications by Guy Smith - Ferrier ClickOnce is a nice way to deploy your…

  • Teched Developer 2007: Day 3

    09u: LINQ to XML: Using the language integrated query ( LINQ ) framework with XML data by Mike Taulgy Accessing data from a XML document used to…

  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment