Hello,
Following a recent review, we've decided to reopen this item. While it has received limited community interest over the years, we believe it addresses a valid scenario and is worth keeping active. We encourage everyone interested in this request to vote for it and share additional details about their specific use case to help us better understand its relevance and demand.
In the meantime, a possible workaround is to recreate the Chart when it should hide all series:
<TelerikTreeList Data="@AllRows"
ItemsField="ChildRows"
HasChildrenField="HasChildren"
SelectionMode="TreeListSelectionMode.Multiple"
SelectedItems="SelectedRows"
SelectedItemsChanged="@SelectedRowsChanged"
TItem="@RowData">
<TreeListColumns>
<TreeListCheckboxColumn Locked="true" Width="40px" />
<TreeListColumn Field="Value1"></TreeListColumn>
<TreeListColumn Field="Value2"></TreeListColumn>
<TreeListColumn Field="Value3"></TreeListColumn>
<TreeListColumn Field="Value4"></TreeListColumn>
</TreeListColumns>
</TelerikTreeList>
@SelectedRows?.Count()
@if (ShouldRenderChart)
{
<TelerikChart>
<ChartSeriesItems>
@if ( SelectedRows is not null)
{
@foreach (RowData row in SelectedRows)
{
var adatok = row.DataList.Select( c => (object)c );
<ChartSeries Type="ChartSeriesType.Column" Data="@adatok">
</ChartSeries>
}
}
</ChartSeriesItems>
<ChartValueAxes>
<ChartValueAxis>
<ChartValueAxisLabels></ChartValueAxisLabels>
</ChartValueAxis>
</ChartValueAxes>
<ChartCategoryAxes>
<ChartCategoryAxis>
<ChartCategoryAxisLabels Font="bold 14px 'Times New Roman'" />
</ChartCategoryAxis>
</ChartCategoryAxes>
<ChartLegend Position="ChartLegendPosition.Right">
</ChartLegend>
</TelerikChart>
}
@code {
public List<RowData>? AllRows { get; set; }
public IEnumerable<RowData>? SelectedRows { get; set; } = new List<RowData>();
private bool ShouldRenderChart { get; set; } = true;
private async Task SelectedRowsChanged(IEnumerable<RowData> newRows)
{
SelectedRows = newRows;
if (SelectedRows.Count() == 0)
{
ShouldRenderChart = false;
await Task.Delay(1);
ShouldRenderChart = true;
}
}
protected override async Task OnAfterRenderAsync( bool first )
{
if ( !first )
return;
AllRows = new List<RowData>()
{
new RowData()
{
DataList = new List<int>() { 3, 6, 9, 4 }
},
new RowData()
{
DataList = new List<int>() { 5, 3, 2, 7 }
},
new RowData()
{
DataList = new List<int>() { 8, 3, 9, 6 }
},
new RowData()
{
DataList = new List<int>() { 4, 5, 1, 0 }
},
};
StateHasChanged();
}
public class RowData
{
public List<RowData> ChildRows { get; set; } = new List<RowData>();
public bool HasChildren { get; set; } = false;
public List<int> DataList { get; set; } = new List<int>() { 0, 0, 0, 0 };
public int Value1
{
get
{
return DataList[0];
}
}
public int Value2
{
get
{
return DataList[1];
}
}
public int Value3
{
get
{
return DataList[2];
}
}
public int Value4
{
get
{
return DataList[3];
}
}
}
}
Regards,
Dimo
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hello,
This behavior was originally reported over X years ago and has not received significant demand or follow-up from the community since then. This is why we plan to prioritize more impactful and widely requested improvements.
If this limitation is still affecting your scenario, please share additional context or use cases. This will help us better assess the severity and reconsider prioritization in the future. Thank you!
Regards,
Petar Mladenov
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.