Skip to main content
All docs
V23.2

DxDropDownEditSettings.DropDownBodyCssClass Property

Specifies CSS classes applied to the body of the editor’s drop-down window.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(null)]
[Parameter]
public string DropDownBodyCssClass { get; set; }

Property Value

Type Default Description
String null

CSS class names delimited by space characters.

Remarks

Specify this property to customize the body appearance of the editor’s drop-down window. The example below demonstrates how to customize drop-down body appearance in a combo box editor:

Drop-Down Body Css Class

@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory

<style>
    .my-class {
        background-color:lavender;
    }
</style>

<DxGrid Data="Products"
        EditMode="GridEditMode.EditRow">
    <Columns>
        <DxGridCommandColumn />
        <DxGridDataColumn FieldName="CategoryId" Caption="Category">
            <EditSettings>
                <DxComboBoxSettings Data="Categories"
                                    ValueFieldName="CategoryId"
                                    TextFieldName="CategoryName"
                                    DropDownBodyCssClass="my-class" />
            </EditSettings>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="ProductName" Width="25%" />
        <DxGridDataColumn FieldName="UnitPrice" />
        <DxGridDataColumn FieldName="UnitsInStock" />
        <DxGridDataColumn FieldName="QuantityPerUnit" />
    </Columns>
</DxGrid>

@code {
    NorthwindContext Northwind { get; set; }
    List<Product> Products { get; set; }
    List<Category> Categories { get; set; }

    protected override async Task OnInitializedAsync() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        Products = await Northwind.Products.ToListAsync();
        Categories = await Northwind.Categories.ToListAsync();
    }

    public void Dispose() {
        Northwind?.Dispose();
    }
}

To apply/remove CSS classes to/from the editor’s drop-down window body at runtime, use the IDropDownEditSettings.DropDownBodyCssClass property.

See Also