Hello!
I followed the tutorial to create a custom shape for a RadDiagram in WPF:
https://docs.telerik.com/devtools/wpf/controls/raddiagram/howto/create-custom-shape
But there is no explanation on how I could add mouse interaction (or other events).
Binding normal values works fine, but if I try to bind, for example:
<Ellipse MouseDown="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=MyMouseDownFunction}" />
I receive an error: "A 'Binding' can only be set on a DependencyProperty of a DependencyObject.'".
How can I add mouse interaction to certain parts of my custom shape?
This is my code.
I want real-time graph.
But when i play the graph, the graph have some blinking.
I want to remove the blinking.
How can i do?
And what is the cause of this blinking?
<!--Chart-->
<telerik:RadCartesianChart x:Name="Chart" Palette="Windows8" Grid.Column="0" ClipToBounds="False" Margin="0,10,0,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDown">
<prism:InvokeCommandAction Command="{Binding MouseDownCommand}" />
</i:EventTrigger>
<i:EventTrigger EventName="MouseMove">
<prism:InvokeCommandAction Command="{Binding MouseMoveCommand}" />
</i:EventTrigger>
<i:EventTrigger EventName="MouseUp">
<prism:InvokeCommandAction Command="{Binding MouseUpCommand}" />
</i:EventTrigger>
<i:EventTrigger EventName="MouseLeave">
<prism:InvokeCommandAction Command="{Binding MouseLeaveCommand}" />
</i:EventTrigger>
<i:EventTrigger EventName="MouseWheel">
<prism:InvokeCommandAction Command="{Binding MouseWheelCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<!--Axis-->
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:CategoricalAxis x:Name="horizontalAxis" SmartLabelsMode="SmartStep" Title="{x:Static prop:Resources.TIME_AXIS}"/>
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis x:Name="verticalAxis" FontFamily="Segoe UI" SmartLabelsMode="SmartStepAndRange" Title="{x:Static prop:Resources.STR_VALUE}">
</telerik:LinearAxis>
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.Grid>
<telerik:CartesianChartGrid MajorLinesVisibility="Y" MajorYLineDashArray="3,4" />
</telerik:RadCartesianChart.Grid>
<!--Track Ball-->
<telerik:RadCartesianChart.TrackBallInfoStyle>
<Style TargetType="telerik:TrackBallInfoControl">
<Setter Property="Header" Value="{Binding TrackBallHeaderText}"/>
<Setter Property="Opacity" Value="0.7" />
</Style>
</telerik:RadCartesianChart.TrackBallInfoStyle>
<telerik:RadCartesianChart.TrackBallLineStyle>
<Style TargetType="Polyline">
<Setter Property="Stroke" Value="Red" />
</Style>
</telerik:RadCartesianChart.TrackBallLineStyle>
<telerik:RadCartesianChart.Behaviors>
<telerik:ChartTrackBallBehavior ShowTrackInfo="{Binding IsVisibleTrackInfo}" ShowIntersectionPoints="True" TrackInfoUpdated="ChartTrackBallBehavior_TrackInfoUpdated" local:ChartUtilities.TrackBallGroup="g1" />
</telerik:RadCartesianChart.Behaviors>
<!--Annotations-->
<telerik:RadCartesianChart.Annotations>
<telerik:CartesianGridLineAnnotation x:Name="ChartAnnotation" Axis="{Binding ElementName=horizontalAxis}" Stroke="Red" StrokeThickness="1.5"
Value="{Binding CurrentPosition}" Label="{x:Static prop:Resources.STR_CURRENT_POSITION}" ClipToBounds="False" ClipToPlotArea="False">
<telerik:CartesianGridLineAnnotation.LabelDefinition>
<telerik:ChartAnnotationLabelDefinition Location="Top"
HorizontalAlignment="Center"/>
</telerik:CartesianGridLineAnnotation.LabelDefinition>
</telerik:CartesianGridLineAnnotation>
</telerik:RadCartesianChart.Annotations>
<telerik:RadCartesianChart.SeriesProvider>
<telerik:ChartSeriesProvider Source="{Binding Data}" SeriesCreated="ChartSeriesProvider_SeriesCreated">
<telerik:ChartSeriesProvider.SeriesDescriptors>
<telerik:CategoricalSeriesDescriptor CategoryPath="Category"
ValuePath="Value"
ItemsSourcePath="Items">
<telerik:CategoricalSeriesDescriptor.Style>
<Style TargetType="telerik:LineSeries">
<Setter Property="VirtualizingPanel.IsVirtualizing" Value="True"/>
<Setter Property="VirtualizingPanel.VirtualizationMode" Value="Standard"/>
<Setter Property="Stroke" Value="{Binding Path=Color}">
</Setter>
<!--<Setter Property="LegendSettings" Value="{Binding Path=SeriesName, Converter={StaticResource LegendSettingsValueConverter}}"/>-->
<Setter Property="TrackBallInfoTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="5,0,0,0">
<TextBlock Text="{Binding DataPoint.Presenter.DataContext.SeriesName}"/>
<TextBlock Text=" : " FontWeight="Bold" />
<TextBlock Text="{Binding DataPoint.Value, StringFormat=0.0#}" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:CategoricalSeriesDescriptor.Style>
</telerik:CategoricalSeriesDescriptor>
</telerik:ChartSeriesProvider.SeriesDescriptors>
</telerik:ChartSeriesProvider>
</telerik:RadCartesianChart.SeriesProvider>
</telerik:RadCartesianChart>
Hello,
please give me a sample project of draw diagram using dynamic data.
(used demo image for create data)
Hi
Please find my below code showing the celledittemplate
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<tbcontrols:SmartSearchRadAutoCompleteBox x:Name="JournalSuggestions" AutomationProperties.AutomationId="JournalSuggestions"
Style="{StaticResource SmartControlStyle}"
SelectionMode="Single"
KeyDown="JournalSuggestions_KeyDown"
PreviewGotKeyboardFocus="JournalSuggestions_PreviewGotKeyboardFocus"
Populating="JournalSuggestions_Populating"
Width="{Binding RelativeSource={RelativeSource AncestorType=telerik:GridViewDataColumn}, Path=ActualWidth}"
BorderThickness="0"
BorderBrush="Transparent"
ClipToBounds="True"
AutoCompleteMode="Suggest"
ItemsSource="{Binding Source={StaticResource SmartJournalAccounts}}"
DisplayMemberPath="Code"
FilteringBehavior="{StaticResource LocalJournalFilter}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
VerticalContentAlignment="Center"
DropDownItemTemplate="{Binding Source={StaticResource CustomDropDownTemplate}}"
NoResultsContentTemplate="{StaticResource NoResultsContentTemplate}"
DropDownWidth="Auto"
BoxesItemStyle="{StaticResource CustomRadAutoCompleteBoxesItemStyle}"
IsEnabled="True"
Margin="-17 0 0 0"
SearchText="{Binding DataContext.SmartControlSearchText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}, UpdateSourceTrigger=PropertyChanged, Mode=OneWayToSource}"
SelectedItem="{Binding Path=SmartJournalAccountItem, Mode=TwoWay}"
TextSearchMode="Contains" TextBoxStyle="{StaticResource TrailBalanceAccountTextBoxStyle}" FontSize="12" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cal:ActionMessage MethodName="AutoCompleteBoxSelectionChanged">
<cal:Parameter Value="{Binding SelectedItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadAutoCompleteBox}}}"></cal:Parameter>
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
<i:Interaction.Behaviors>
<behaviours:RadAutoCompleteBoxBehavior/>
</i:Interaction.Behaviors>
</tbcontrols:SmartSearchRadAutoCompleteBox>
<Button x:Name="SearchButton" Grid.Column="1"
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=controls:APTPanel}}"
Click="SearchButton_Click">
<Button.Visibility>
<con:ConverterBindableBinding Binding="{Binding IsSearchAccountVisible,UpdateSourceTrigger=PropertyChanged}"
Converter="{StaticResource BooleanToVisibilityConverter}"
ConverterParameterBinding="{Binding IsSearchAccountVisible, RelativeSource={RelativeSource AncestorType={x:Type controls:APTPanel}}, UpdateSourceTrigger=PropertyChanged}">
</con:ConverterBindableBinding>
</Button.Visibility>
</Button>
</Grid>
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
If I click the "SearchButton" on first click the event does not fire, the click event fires if I click it second time.
If I remove the SmartSearchRadAutoCompleteBox control & only keep the SearchButton then it works ok.
Can someone give me code snippet having multiple controls (one radautosearchbox & one button) in datatemplate of celledittemplate or help me understand what is causing issue in my Click event
Regards,
Swapnil.
Hello,
How can I change the header button text color and the week number text color (see attachment)?
Kind regards
if (mainChart.Camera is ProjectionCamera) { ProjectionCamera projectionCamera = (ProjectionCamera)mainChart.Camera; Point3D point3D = projectionCamera.Position; point3D.X = 714; point3D.Y = -1852; point3D.Z = 1255; projectionCamera.Position = point3D; Vector3D vector3D = projectionCamera.LookDirection; vector3D.X = -114; vector3D.Y = 1952; vector3D.Z = -665; projectionCamera.LookDirection = vector3D; }
I have the above code to try to set the initial camera position via the Loaded event but it does not work.
If I use the code on a keydown event it moves the camera to the position that I want.
What am I missing to make it set the initial camera position?
Hi,
I have a RadGridView in WPF where I use CustomGrouping for displaying it as a hierarchical structure. I set on it AutoExpandGroups="True" in order to be expanded by default. My problem is, if I manually collapse something in the RadGridView and I make an update to the list bounded to ItemsSource, the RadGridView automatically expands and does not stay as it was.
Thanks
Hello,
Please reproduce:
1. Open Telerik Editor and enable Track change
2. Insert Hyperlink
3. Hyperlink added, but not marked as Inserted:
Note: Copy and Paste with hyperlink is working as Track Change
Is it a bug? How can it may be fixed? Any solution to fix it?
Thank you!
Hello,
I'm having some rendering issues with a HwndHost element (set as child of a Border object) that I've partially fixed using RadWindowInteropHelper.SetAllowTransparency method in a NonTrasparentWindowsGeneratedItemsFactory class.
However, there is still one problem, namely, when the window, which contains that Border element, is being maximised using the Telerik docking system, it doesn't render the content of the HwndHost element inside the Border (it looks empty). Also I've noticed that when the window is finally maximised, if the pointer goes over that empty area, the window disappears suddenly.
What could it be?
Thanks,
G.
<telerik:RadCartesianChart3D>
<telerik:RadCartesianChart3D.XAxis>
<telerik:CategoricalAxis3D />
</telerik:RadCartesianChart3D.XAxis>
<telerik:RadCartesianChart3D.YAxis>
<telerik:CategoricalAxis3D />
</telerik:RadCartesianChart3D.YAxis>
<telerik:RadCartesianChart3D.ZAxis>
<telerik:LinearAxis3D />
</telerik:RadCartesianChart3D.ZAxis>
<telerik:RadCartesianChart3D.Series>
<telerik:BarSeries3D ItemsSource="{Binding TheDataPoints}">
</telerik:BarSeries3D>
</telerik:RadCartesianChart3D.Series>
<telerik:RadCartesianChart3D.Grid>
<telerik:CartesianChart3DGrid />
</telerik:RadCartesianChart3D.Grid>
</telerik:RadCartesianChart3D>