Stacked Data bar in a DataTemplate

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    12 posts
    Member since:
    Oct 2011

    Posted 25 May 2012 Link to this post


    When using a Databar inside a RadGrid along with a Data Templete the stacked Data bar will only display the first 2 items from the collections. Or am I missing something ?

    <telerik:GridViewDataColumn Width="*" SortMemberPath="TotalTakingsValue" >
                                                    <TextBlock Text="Takings" />
                                                <Style TargetType="telerik:GridViewCell">
                                                    <Setter Property="ContentTemplate">
                                                                        <ColumnDefinition Width="80" />
                                                                        <ColumnDefinition />
                                                                    <TextBlock Text="{Binding TotalTakingsValue, StringFormat='{}{0:c}'}" HorizontalAlignment="Right" Margin="0 0 10 0" VerticalAlignment="Center" />
                                                                    <StackPanel Orientation="Vertical" Grid.Column="1">
                                                                        <telerik:RadStackedDataBar  x:Name ="TakingsStackBar" Height="18" Margin="2" Maximum="9000"  ValuePath="Amount" ToolTipFormat="c" ToolTipPath="Amount"  ItemsSource="{Binding KPITakingsBarData}" ShowToolTips="True" >
                                                                        <telerik:RadDataBar x:Name="TakingsTargetBar" Value="{Binding KPITakings}" Maximum="{Binding Path=Text, ElementName=MaxBarData}"  LabelVisibility="Collapsed" Height="2" Margin="0 0 3 0"  ToolTipService.ToolTip="{Binding KPITakings,StringFormat='{}{0:c}'}"  />
                                                <telerik:SumFunction Caption="        " ResultFormatString="{}{0:c}" SourceField="TotalServiceValue" />
  2. Petar Marchev
    Petar Marchev avatar
    1010 posts

    Posted 29 May 2012 Link to this post

    Hello Andy,

    Thank you for the attached code. I  created a small project based on the code you provided. I was not able to reproduce the behavior that you describe. I have attached to this post the project with which I tested, and a snapshot of the results that I get. Please examine the demo app and let us know if you get different results.

    If you keep experiencing problems with this I will ask that you prepare a small project that reproduces this issue so that we can test and investigate its origins. The only thing that comes to my mind right now is that if you have negative values - then you would not see these bars because the Minimum of the StackedDataBar is 0 and negative values are drawn to the left.

    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top