1
DropDownList
の最大値をASP.NET
に設定するにはどうすればC#
を得ることができますか?DropDownListの最大値 - ASP.NET
方法はありますか手動で取得する必要がありますか?
DropDownList
の最大値をASP.NET
に設定するにはどうすればC#
を得ることができますか?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