T
Tony Maresca
I am binding a combo box to an ArrayList of
objects with a property called "Name" that is
assigned to DisplayMember.
How can I have the SelectedValue of the combo
return the instance of the object whose Name
property is selected in the combo?
I know that I can add a property like this:
public class MyObject
{
public MyObject Value {get{return this;}}
}
And set ValueMember to "Value".
But, I was wondering if there was any special
designation I could just set ValueMember to,
since I don't always work with my own objects
or non-sealed objects, and hence, can't always
add the property.
--
Tony M.
objects with a property called "Name" that is
assigned to DisplayMember.
How can I have the SelectedValue of the combo
return the instance of the object whose Name
property is selected in the combo?
I know that I can add a property like this:
public class MyObject
{
public MyObject Value {get{return this;}}
}
And set ValueMember to "Value".
But, I was wondering if there was any special
designation I could just set ValueMember to,
since I don't always work with my own objects
or non-sealed objects, and hence, can't always
add the property.
--
Tony M.