This is a migrated thread and some comments may be shown as answers.

Label template bindings not updating

1 Answer 138 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Flemming
Top achievements
Rank 1
Flemming asked on 24 Jan 2019, 10:26 AM

Hi

I have a RadPieChart with a Doughnut series:

   <telerik:RadPieChart x:Name="PieChart">
            <telerik:DoughnutSeries x:Name="PieSeries1" ValueBinding="Value" ItemsSource="{Binding Items}" InnerRadiusFactor="0.4" RadiusFactor="0.8" DefaultSliceStyle="{StaticResource PieSliceStyle}">
                <telerik:PieSeries.LabelDefinitions>
                    <telerik:ChartSeriesLabelDefinition Template="{StaticResource LabelTemplate1}"/>
                </telerik:PieSeries.LabelDefinitions>
            </telerik:DoughnutSeries>
        </telerik:RadPieChart>

This is the label template:

  <DataTemplate x:Key="LabelTemplate1">
            <TextBlock Foreground="#FFB6B6B6"
                       Text="{Binding Path=DataItem.Label}"
                       Visibility="{Binding Path=DataItem.Visibility}"
                       FontSize="18" FontFamily="Segoe UI" TextAlignment="Center" />
        </DataTemplate>

The data objects I bind to in the template implements “INotifyPropertyChanged” and the properties raise the “PropertyChanged” event when changed. This works fine elsewhere.

The labels gets their initial label text/visibility fine. But if I update the values - it is not reflected to the labels.

I bind to the data objects in the “DefaultSliceStyle” too and it works fine when updating.

Any ideas why – and is there an alternative solution?

/Flemming

1 Answer, 1 is accepted

Sort by
0
Dinko
Telerik team
answered on 28 Jan 2019, 02:28 PM
Hello Flemming,

Thank you for the provided code snippets.

I have double check this and was able to update the values and labels of the slices. You can find the project which I used to test your scenario. Can you take a look at this project and let me know if I am missing additional code in order to reproduce this behavior?

I am looking forward to your reply.

Regards,
Dinko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ChartView
Asked by
Flemming
Top achievements
Rank 1
Answers by
Dinko
Telerik team
Share this question
or