前端:
<dxe:ASPxComboBox ID="cbxClassId" runat="server" Width="250px" ClientInstanceName="cbxClassId">
</dxe:ASPxComboBox>
后台实现方法:
EditorBinder.BindCustomerType(cbxClassId, true);//绑定下拉框数据
public static void BindCustomerType(ASPxComboBox cbx, bool select)
{
cbx.ValueField = "CLASS_ID";
cbx.TextField = "CLASS_NAME";
var entities = CustomerService.GetCustomerClasses();//数据集
if (select) entities.Insert(0, new CM_BAS_CUSTOMER_CLASS() { CLASS_NAME = "请选择", CLASS_ID = "" });
LoadDropDown<CM_BAS_CUSTOMER_CLASS>(cbx, "CLASS_ID", "CLASS_NAME", "CLASS_ID", "PARENT_CLASS_ID", "", entities, true);
//cbx.DataSource = entities;
//cbx.DataBind();
}
/// <summary>
/// 加载下拉框
/// </summary>
/// <typeparam name="Category">可根据泛型获取数据</typeparam>
/// <param name="ctl">DropDown控件ID或控件</param>
/// <param name="propId"&g