DevExpress中ComboBoxEdit控件用法

1.绑定数据

public static DataTable GetAreaDataTable()
        {
            string sqlStr = "select type from TypeList where ID=3";
            DataBase db = new DataBase();
            DataTable dt = db.GetDataTable(sqlStr);
            return dt;
        }

private void LoadComboBoxEdit()
         {
             this.comboBoxEdit1.Properties.NullText = "请选择...";
             DataTable dt = GetAreaDataTable();
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 comboBoxEdit1.Properties.Items.Add(dt.Rows[i]["type "].ToString());
             }
         }

fC9BTpsoz

 

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容