Telerik Forums
UI for Silverlight Forum
3 answers
108 views
Hi

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" >
                                        <telerik:GridViewColumn.Header>
                                            <StackPanel>
                                                <TextBlock Text="Takings" />
                                            </StackPanel>
                                        </telerik:GridViewColumn.Header>
                                        <telerik:GridViewColumn.CellStyle>
                                            <Style TargetType="telerik:GridViewCell">
                                                <Setter Property="ContentTemplate">
                                                    <Setter.Value>
                                                        <DataTemplate>
                                                            <Grid>
                                                                <Grid.ColumnDefinitions>
                                                                    <ColumnDefinition Width="80" />
                                                                    <ColumnDefinition />
                                                                </Grid.ColumnDefinitions>
                                                                <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:RadStackedDataBar>
                                                                    <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}'}"  />
                                                                </StackPanel>
 
                                                            </Grid>
                                                        </DataTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </telerik:GridViewColumn.CellStyle>
                                        <telerik:GridViewDataColumn.AggregateFunctions>
                                            <telerik:SumFunction Caption="        " ResultFormatString="{}{0:c}" SourceField="TotalServiceValue" />
                                        </telerik:GridViewDataColumn.AggregateFunctions>
                                    </telerik:GridViewDataColumn>
Martin Ivanov
Telerik team
 answered on 10 Sep 2018
3 answers
39 views
Let make simple test.
This is xaml

<Grid x:Name="LayoutRoot">
 
 
  
 
        <telerik:HeaderedItemsControl >
                <telerik:HeaderedItemsControl.Items >
                    <ItemsControl>                     
                        <telerik:RadDataBar MinHeight="30" BarHeightPercent="1"
                                            Value="-5.40"
                                            Minimum="-3053822.75"
                                            Maximum="3053822.75"                                                
                                            BorderBrush="Black" BorderThickness="1" Margin="2"
                                            LabelFormat="0.# m"
                                            NegativeValueBrush="Red"
                                            ValueBrush="Green"
                                            LabelPosition="EndOfBarOutside" AxisStroke="#FF10EA24" Foreground="Black" />
                    </ItemsControl>
                    <ItemsControl>
                        <telerik:RadDataBar MinHeight="30" BarHeightPercent="1"
                                            Value="5.40"
                                            Minimum="-3053822.75"
                                            Maximum="3053822.75"                                                
                                            BorderBrush="Black" BorderThickness="1" Margin="2"
                                            LabelFormat="0.# m"
                                            NegativeValueBrush="Red"
                                            ValueBrush="Green"
                                            LabelPosition="EndOfBarOutside" AxisStroke="#FF10EA24" Foreground="Black" />
                    </ItemsControl>
                    <ItemsControl>
                        <telerik:RadDataBar MinHeight="30" BarHeightPercent="1"
                                            Value="22000.75"
                                            Minimum="-3053822.75"
                                            Maximum="3053822.75"                                                
                                            BorderBrush="Black" BorderThickness="1" Margin="2"
                                            LabelFormat="0.# m"
                                            NegativeValueBrush="Red"
                                            ValueBrush="Green"
                                            LabelPosition="EndOfBarOutside" AxisStroke="#FF10EA24" Foreground="Black" />
                    </ItemsControl>
                    <ItemsControl>
                        <telerik:RadDataBar MinHeight="30" BarHeightPercent="1"
                                            Value="-22000.75"
                                            Minimum="-3053822.75"
                                            Maximum="3053822.75"                                                
                                            BorderBrush="Black" BorderThickness="1" Margin="2"
                                            LabelFormat="0.# m"
                                            NegativeValueBrush="Red"
                                            ValueBrush="Green"
                                            LabelPosition="EndOfBarOutside" AxisStroke="#FF10EA24" Foreground="Black" />
                    </ItemsControl>
                    <ItemsControl>
                        <telerik:RadDataBar MinHeight="30" BarHeightPercent="1"
                                            Value="3053822.75"
                                            Minimum="-3053822.75"
                                            Maximum="3053822.75"                                                
                                            BorderBrush="Black" BorderThickness="1" Margin="2"
                                            LabelFormat="0.# m"
                                            NegativeValueBrush="Red"
                                            ValueBrush="Green"
                                            LabelPosition="EndOfBarOutside" AxisStroke="#FF10EA24" Foreground="Black" />
                    </ItemsControl>
                <ItemsControl>
                    <telerik:RadDataBar MinHeight="30" BarHeightPercent="1"
                                            Value="500.75"
                                            Minimum="-3053822.75"
                                            Maximum="3053822.75"                                                
                                            BorderBrush="Black" BorderThickness="1" Margin="2"
                                            LabelFormat="0.# m"
                                            NegativeValueBrush="Red"
                                            ValueBrush="Green"
                                            LabelPosition="EndOfBarOutside" AxisStroke="#FF10EA24" Foreground="Black" />
                </ItemsControl>
 
 
            </telerik:HeaderedItemsControl.Items>
            </telerik:HeaderedItemsControl>
     
 
    </Grid>


Run project and change layout size of browser with mouse.
Some time show wrong chart, sometime it is correct.
This control not work! See first two scale and change browser size.

See attached image...
Peshito
Telerik team
 answered on 04 Mar 2014
1 answer
70 views
Hi!

I had a requirement wrt RadStackedDataBar that it has to be rounded on the either corners.

I tried the following, but was unable to achieve it
<Border CornerRadius="10,10,10,10" BorderThickness="1" BorderBrush="White" HorizontalAlignment="Left">
<telerik:RadStackedDataBar  Height="20" ItemsSource="{Binding CList}" ValuePath="Value" ToolTipPath="ToolTip" ShowToolTips="True" Maximum="100" >
                                <telerik:RadStackedDataBar.BarBrushes>
                                    <dataBars:BrushCollection>
                                        <SolidColorBrush Color="Red" />
                                        <SolidColorBrush Color="Blue" />
                                    </dataBars:BrushCollection>
                                </telerik:RadStackedDataBar.BarBrushes>
                            </telerik:RadStackedDataBar>
</Border>
 
PFA image with the result of the following

Any help on this regard is welcome

BR,
/Nav
Evgenia
Telerik team
 answered on 10 Jun 2013
1 answer
59 views
The RadDataBar seems to handle Infinity OK, but setting Maximum to Infinity crashes the control (and the app hosting it). Seems like if Value can handle it, Minimum and Maximum should as well. Has this been reported?

Luke
Petar Marchev
Telerik team
 answered on 25 Apr 2012
2 answers
77 views
Hi!

I am using
your excellent control RadStackedDataBar. Tell me is it possible to make custom TooltipTemplate for this control like it can be done for RadChartView? I need to show the series name and value in different colors in this tooltip.
Nova
Top achievements
Rank 1
 answered on 11 Apr 2012
3 answers
119 views
We're trying to use the new RadDataBar-control inside a ListBox but it doesn't seem to work. First we thought that we're just doing something wrong when binding the value of the DataBar to the collection but even with a hard-coded value the DataBar isn't shown.

If we only have a hard-coded RadDataBar, we can see it correctly:
<telerik:RadDataBar Height="20" Margin="2" BorderBrush="Gray" BorderThickness="1" Value="-10" OriginValue="30" />

But if the RadDataBar is inside a DataTemplate, it's not working:

<ListBox Grid.Row="1" x:Name="Items">
    <ListBox.ItemTemplate>
        <DataTemplate>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
 
                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Name}" />
                <telerik:RadDataBar Grid.Column="1"
                                    Height="20"
                                    Margin="2"
                                    BorderBrush="Gray"
                                    BorderThickness="1"
                                    Value="-10"
                                    OriginValue="30"/>
            </Grid>
 
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

When run, we can see the TextBlock's OK but even though the RadDataBar's value is fixed to -10, the bar isn't drawn at all.

Any ideas?
Mikael
Top achievements
Rank 1
 answered on 22 Mar 2012
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?