Skip to main content
All docs
V25.1
  • DxTreeListSummaryItem.Visible Property

    Specifies whether a summary item is visible.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    [DefaultValue(true)]
    [Parameter]
    public bool Visible { get; set; }

    Property Value

    Type Default Description
    Boolean true

    true if the summary item is visible; otherwise, false.

    Remarks

    Use this property to show or hide individual summary items in code.

    If you set an item’s Visible property to false, this item is removed from the TreeListColumnFooterTemplateContext.SummaryItems collection.

    The following code snippet displays a total summary value above the TreeList component:

    <h3>Total Sales: @SummaryText</h3>
    <DxTreeList @ref="TreeList"
                Data="Data"
                KeyFieldName="ID"
                ParentKeyFieldName="RegionID"
                ShowAllRows="true">
        <Columns>
            <DxTreeListDataColumn FieldName="Region" />
            <DxTreeListDataColumn FieldName="MarchSales" DisplayFormat="c0" />
            <DxTreeListDataColumn FieldName="MarchChange" DisplayFormat="p2" />
            <DxTreeListDataColumn FieldName="MarketShare" DisplayFormat="p0" />
        </Columns>
        <TotalSummary>
            <DxTreeListSummaryItem SummaryType="TreeListSummaryItemType.Sum" FieldName="MarchSales" Visible="false" />
        </TotalSummary>
    </DxTreeList>
    
    @code {
        ITreeList TreeList { get; set; }
        object Data { get; set; }
        string SummaryText;
    
        protected override void OnInitialized() {
            Data = SalesByRegionDataProvider.GenerateData();
        }
    
        protected override void OnAfterRender(bool firstRender) {
            if(firstRender) {
                SummaryText = TreeList.GetTotalSummaryFormattedValue(TreeList.GetTotalSummaryItems()[0]);
                StateHasChanged();
            }
        }
    }
    

    Blazor TreeList - Summary Outside a TreeList

    For more information about summaries in the TreeList component, refer to the following topic: Summary in Blazor TreeList.

    Implements

    See Also