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

How to create markers (or customItems) on demand

1 Answer 114 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Chris asked on 11 Jun 2012, 07:07 PM
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" />

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 14 Jun 2012, 08:20 AM
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 >>

Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question