Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxGrid.TextWrapEnabled Property

Specifies whether the Grid wraps words or trims extra words and displays an ellipsis.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(true)]
[Parameter]
public bool TextWrapEnabled { get; set; }

#Property Value

Type Default Description
Boolean true

true to wrap words; false to trim extra words and display an ellipsis.

#Remarks

If a value does not fit into a cell as a single line, the cell displays multiple lines of text. Set the TextWrapEnabled property to false to disable word wrap and trim extra words in the following Grid elements (in other Grid elements, word wrap is always enabled):

Instead of trimmed characters, the Grid component displays an ellipsis. Users can hover over the cell to display all the text in a tooltip.

Run Demo: Virtual Scrolling

Note

The Grid does not display ellipsis characters and tooltips for cells whose content is defined by a template and includes block-level elements.

The following code snippet disables text wrapping:

<DxGrid Data="@Data" 
        TextWrapEnabled="false">
    <Columns>
        <DxGridDataColumn FieldName="CompanyName" />
        <DxGridDataColumn FieldName="ContactName" />
        <DxGridDataColumn FieldName="ContactTitle" />
        <DxGridDataColumn FieldName="Country" Width="10%" />
        <DxGridDataColumn FieldName="City" Width="10%" />
        <DxGridDataColumn FieldName="Address" />
        <DxGridDataColumn FieldName="Phone" Width="10%" />
    </Columns>
</DxGrid>

@code {
    object Data { get; set; }

    protected override async Task OnInitializedAsync() {
        var suppliers = await NwindDataService.GetSuppliersAsync();
        Data = suppliers.Select(s => { 
            return new {
                CompanyName = s.CompanyName,
                ContactName = s.ContactName,
                ContactTitle = s.ContactTitle,
                Country = s.Country,
                City = s.City,
                Address = s.Address,
                Phone = s.Phone
            };
        });
    }
}

#Implements

See Also