dropdownlistfor fill values
I have a table T with fields id, parentid
, name. i make relationship with own table so parentid=>id one to many, so if parentid=null
it is a parent record, and if parentid
n开发者_Go百科ot null it is child record.
After mapping I have class with 2 new properties- T1 (Collection of T) and T2 (Instance of T)
How can I fill dropdownlistfor
if I don't have field parentid
filled?
You should use the ID field for the DataValueField. That way it's always unique... or am I missing something?
精彩评论