I
Ily
Hi
I have a collection of person objects that are added to a dictionary,
each items is added with a unque key. Each person object has a first
name property, and a last name property
My problem is I want to bind this to a dropdown list so that the
DataValueField is set to the ID of the Person, and that the
DataTextField displays the firstname of the person. The problem is I
can only set the DataValueField to either "Key" or "Value", but I want
my value to be "FirstName" When I do this I get an error saying:
Databinding "System.Collections.Generic.KeyValuePair does not contain a
aproperty with the name FirstName"
Am I doing something wrong? Can I actually achive what I am trying to
do?
I have a collection of person objects that are added to a dictionary,
each items is added with a unque key. Each person object has a first
name property, and a last name property
My problem is I want to bind this to a dropdown list so that the
DataValueField is set to the ID of the Person, and that the
DataTextField displays the firstname of the person. The problem is I
can only set the DataValueField to either "Key" or "Value", but I want
my value to be "FirstName" When I do this I get an error saying:
Databinding "System.Collections.Generic.KeyValuePair does not contain a
aproperty with the name FirstName"
Am I doing something wrong? Can I actually achive what I am trying to
do?