1

我正在使用带有几个组合框的 DEvExpress mvc 网格,我想知道如何设置下拉部分的最大/最小高度(在多行中)。

例如,我是否可以在必须滚动之前设置可见的行,或者即使只有一行数据可以将下拉高度设置为一定数量的行。

我现在拥有的组合的当前代码是

@Html.DevExpress().ComboBox(edtSettings =>
{
    edtSettings.ControlStyle.CssClass = "employeeDetailsGridEditField";
    edtSettings.Name = "DepartmentID";
    edtSettings.Width = 350;
    //edtSettings.Height = 200; 
    //THIS sets the height of the initial control not the drop down part
    edtSettings.Properties.TextField = "DepartmentName";
    edtSettings.Properties.ValueField = "DepartmentID";
    edtSettings.Properties.ValueType = typeof(int);
    edtSettings.Properties.DropDownStyle = DropDownStyle.DropDown;
    edtSettings.ShowModelErrors = true;
}).BindList(Model.DepartmentList).Bind(Model.EmployeeSingle.DefaultDepartmentID).GetHtml()

下拉部分高度是否有属性?

4

1 回答 1

2

使用ComboBoxProperties.DropDownRows属性来获取或设置同时显示在编辑器的可滚动下拉窗口中的列表项的数量:

@Html.DevExpress().ComboBox(edtSettings =>
{
    //...
    edtSettings.Properties.DropDownRows = 5; // default is 7 
    //...        
}).BindList(Model.DepartmentList).Bind(Model.EmployeeSingle.DefaultDepartmentID).GetHtml()
于 2013-01-23T09:30:59.797 回答