How to create markers (or customItems) on demand

2 posts, 0 answers
  1. Chris
    Chris avatar
    23 posts
    Member since:
    May 2011

    Posted 11 Jun 2012 Link to this post

    We are creating a linear gauge, it needs to show some extra markers (on-demand based on user's setting, binding to "Markers").
    We tried to add <telerik:LinearScale.CustomItems>, but we can not set up the databinding... and we tried to add
    CustomItems="{Binding Markers}"
    CustomItemTemplate="{StaticResource CustomItemTemplate}"
    but we cannot make it work.

    BTW: as the code shows below, the gauge shows "CurrentFrameNumber" on the top of the gauge, and we would like the extra markers appear on the bottom of the gauge.

    Could you please help?

    <telerik:RadHorizontalLinearGauge Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="TimeGauge" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Margin="0" OuterBackground="#00000000" OuterBorderThickness="0" Background="#00000000" BorderBrush="#00000000">
                    <telerik:LinearScale x:Name="TimeScale"
                                         Min="{Binding Min}"
                                         Max="{Binding Max}"
                                         RelativeWidth="0.92" RelativeY="0.6"
                                         CustomItems="{Binding Markers}"
                                         CustomItemTemplate="{StaticResource CustomItemTemplate}">
                            <telerik:BarIndicator x:Name="TrackBar"
                                                  Value="{Binding CurrentFrameNumber, Mode=TwoWay}" IsAnimated="False" Background="#FF00C500" />
                            <telerik:Marker x:Name="CurrentFrameMarker"
                                            Value="{Binding CurrentFrameNumber, Mode=TwoWay}"
                                    <ControlTemplate TargetType="{x:Type telerik:Marker}">
                                        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                            <Polygon Points="0,0 0,0.7 0.5,1 1,0.7 1,0"
                                                     StrokeThickness="2" />
  2. Andrey
    Andrey avatar
    1681 posts

    Posted 14 Jun 2012 Link to this post

    Hi Chris,

    It is very complicated and it is hard to reproduce the problem without your solution, but using just the code snippet you sent. Could you, please, provide us with your solution or with a small sample solution which reproduces it?

    All the best,
    Andrey Murzov
    the Telerik team

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

Back to Top