DxTreeListSummaryItem.Visible Property
Specifies whether a summary item is visible.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(true)]
[Parameter]
public bool Visible { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | true |
|
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();
}
}
}
For more information about summaries in the TreeList component, refer to the following topic: Summary in Blazor TreeList.
See Also