c# - Set object's nested object's proerty as combo valuemember -


i have combobox. datasource list of objects. class has public property class defined me. set combo's valuemember property of class. how can that?

class b { public int id {get; set;} }  class { public b anyproperty {get; set;} public string name {get; set;} }  var testlist = new list<a>() {...}; combo.datasource = testlist; combo.displaymemver = "name"; combo.valuemember = ??? //it should a.anyproperty.id 

.net4/vs2010/c#

thx

combo.valuemember = "anyproperty"; 

combobox bind object. can value doing this.

var selectedvalue = (b)combobox.selectvalue; 

please not above sytax maybe incorrect.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -