DataBinderTools.BoundComboBox方法,绑定ComboBox组件的下拉数据源-C/S开发框架
用于绑定ComboBox组件的下拉数据源。
public static void BoundComboBox(ComboBoxEdit editor, DataTable dt, string fieldName)
{
editor.Properties.Items.Clear();
editor.Properties.DropDownItemHeight = 25;
foreach (DataRow R in dt.Rows)
{
editor.Properties.Items.Add(R[fieldName]);
}
if (dt.Rows.Count > 0)
editor.Properties.DropDownRows = 10;
else
editor.Properties.DropDownRows = dt.Rows.Count;
}