开发者

dropdownlistfor fill values

开发者 https://www.devze.com 2022-12-21 05:11 出处:网络
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

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消