Dim ds As Data.DataSet
Dim dr As Data.DataRow
ds = SDS.CROCS.DBManager.Plan.Plan.GetPlanListBeforeDateIncludeLive(scheduleRadCalendar.SelectedDate.AddDays(+1))
'读取绑定DropDownList的数据
For i As Integer = 0 To ds.Tables(0).Rows.Count - 1 '按行取出数据
dr = ds.Tables(0).Rows(i)
If dr("status") = 1 Then '根据某列的内容来进行设置默认项
Me.planDropDownList.SelectedIndex = i
Exit For
End If
Next
planDropDownList.DataSource = ds
planDropDownList.DataBind()
本文介绍了一种使用VB.NET从DataSet填充DropdownList的方法,并通过检查特定列的值来设置默认选项。
681

被折叠的 条评论
为什么被折叠?



