1
A
回答
5
int maxValue = DropDownList1.Items.Cast<ListItem>().Select(item => int.Parse(item.Value)).Max();
1
DropDownList1.Items.Cast<ListItem>().Max(j => j.Value) // For string comparison
或者,
DropDownList1.Items.Cast<ListItem>().Max(j => int.Parse(j.Value)) // If you want max int
相關問題
- 1. DropDownList中選擇最低值大於X
- 2. ASP.NET中DropDownList的設置值
- 3. 通過javascript更改dropdownlist的值後,asp.net中dropdownlist的值消失
- 4. ASP.Net DropDownList選擇值
- 5. Asp.Net中的DropDownList
- 6. ASP.NET獲得值的DropDownList
- 7. ASP.NET MVC的DropDownList值HttpPost
- 8. 在asp.net MVC 4.0中的選定值dropdownlist
- 9. asp.net中的C#Dropdownlist
- 10. GridView中的DropDownList asp.net
- 11. ASP.NET MVC DROPDOWNLIST不選擇值
- 12. 檢索DropDownList'值'(C#/ ASP.NET)
- 13. asp.net dropdownlist
- 14. Asp.Net DROPDOWNLIST
- 15. Dropdownlist asp.net
- 16. asp.net DROPDOWNLIST
- 17. ASP.Net的DropDownList選擇的值丟失
- 18. 如何使DropDownList項目的最大值項目粗體C#
- 19. DataBinding ASP.NET MVC中的DropDownList 2
- 20. ASP.NET MVC中的DropDownList 3
- 21. DropDownList中的ASP.NET 2 DataValuefield
- 22. edititemtemplate中的dropdownlist gridview asp.net
- 23. 填充ASP.NET MVC中的DropDownlist
- 24. Dropdownlist與ASP.NET中的圖像
- 25. ASP.NET DropDownList枚舉的選定值
- 26. 獲取DropDownList的選定值。 Asp.NET MVC
- 27. ASP.NET MVC DropDownList選定的值問題
- 28. 在asp.net MVC獲取dropdownlist的選定值
- 29. 入門選定值從ASP.NET的DropDownList
- 30. ASP.NET GridView控件DropDownList的帖子空值
謝謝。有用。 – MSajjadi 2012-04-09 08:10:36