Back to Devexpress

DxTreeView.CheckAllText Property

blazor-devexpress-dot-blazor-dot-dxtreeview-620074ad.md

latest2.2 KB
Original Source

DxTreeView.CheckAllText Property

Specifies the label of the Check All box.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue("Check All")]
[Parameter]
public string CheckAllText { get; set; }

Property Value

TypeDefaultDescription
String"Check All"

The label text of the Check All box.

|

Remarks

When you allow users to check all nodes in the UI, you can specify custom text for the Check all box:

razor
<DxTreeView Data="@Data"
            CheckMode="TreeViewCheckMode.Multiple"
            CheckAllVisible="true"
            CheckAllText="I'll take all!">
    <DataMappings>
        <DxTreeViewDataMapping Text="Name"
                               Key="Id"
                               ParentKey="CategoryId" />
    </DataMappings>
</DxTreeView>

@code {
    List<FlatDataItem> Data { get; set; }
    protected override void OnInitialized() {
        IEnumerable<ProductFlat> products = ProductData.Products;
        IEnumerable<ProductCategory> productSubcategories = ProductData.Categories;
        Data = new List<FlatDataItem>(Enum.GetValues<ProductCategoryMain>().Select(i => new FlatDataItem() { Name = i.ToString(), Id = i }));
        Data.AddRange(products.Select(i => new FlatDataItem() { Name = i.ProductName, Id = i.Id, CategoryId = i.ProductCategoryId }));
        Data.AddRange(productSubcategories.Select(i => new FlatDataItem() { Name = i.Subcategory, Id = i.SubcategoryID, CategoryId = i.Category }));
    }
}

See Also

DxTreeView Class

DxTreeView Members

DevExpress.Blazor Namespace