DropDownList中的最大值 - ASP.NET
答
int maxValue = DropDownList1.Items.Cast<ListItem>().Select(item => int.Parse(item.Value)).Max();
答
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
谢谢。有用。 – MSajjadi 2012-04-09 08:10:36