checkboxlist 如何配置資料來源?
阿新 • • 發佈:2018-12-14
<f:CheckBoxList runat="server" ColumnNumber="4" ColumnVertical="true" ID="checkboxlist1" Label="專案名稱" ></f:CheckBoxList>
後臺程式碼如下:
DataSet myData= mySystem.GetProjectList(Convert.ToInt32(LoginUserDepID), LoginUserDepName); if (myData.Table[0].rows.Count>0) { chbProjectName.Items.Clear(); chbProjectName.DataSource = myData.Tables[0]; chbProjectName.DataTextField = "projectname"; chbProjectName.DataValueField = "f_id"; chbProjectName.DataBind(); }
比較簡單,已完成