Bind a list to silverlight datagrid/datafrom columns

Posted by nilarya on Stack Overflow See other posts from Stack Overflow or by nilarya
Published on 2012-06-09T16:36:14Z Indexed on 2012/06/09 16:40 UTC
Read the original article Hit count: 263

There must be something I am missing, I want to do a very simple thing, for example, I have a class like the following:

public class Person
{
    public int ID { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public DateTime DateOfBirth { get; set; }
    public List<string> phoneNumbers { get; set; }
}

I want to bind it to a dataform by something like this:

 public Person person { get; set; }
 List<string> lst = new List<string>();
        lst.Add("123445");
        lst.Add("2345345");
        lst.Add("4576345");
        lst.Add("456784");
        lst.Add("789067");

        person = new Person()
        {
            ID = 1,
            FirstName = "Kevin",
            LastName = "Dockx",
            DateOfBirth = new DateTime(1981, 5, 5),
            Lookup = lst

        };

and then

  dataForm1.CurrentItem = person;

What I am doing wrong?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about data-binding