Telerik Forums
UI for WPF Forum
0 answers
4 views

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?

Dominic
Top achievements
Rank 1
 asked on 16 Mar 2024
0 answers
9 views

Is there a way to change the anchor point of a RadDiagramShape object to something other than the top/left point?  Like in the screen shot below, it is the top/center point.


Burl
Top achievements
Rank 1
 asked on 05 Mar 2024
1 answer
13 views

Hello!

The RadDiagram has included controls to pan and zoom, but not to rotate one's view of the entire diagram.

I don't mean to rotate just some shapes, but to offer the user an interaction like the "pan", where the view of the complete diagram is rotate around the center.

I tried implementing something like this with a WPF LayoutTransform or RenderTransform, but this always seems to have some ugly side effects.

Is there some easy way to implement something like this?

Thanks in advance.

Martin Ivanov
Telerik team
 answered on 04 Mar 2024
0 answers
14 views

Hi,

I am using <telerik:RadTreeListView> and the scroll functionality does not work. this is how my code looks like:

<UserControl x:Class="WISN.Windows.Survey.FacilityStaffControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:vm="clr-namespace:WISN.Windows.Survey.ViewModels"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">

    <telerik:RadTreeListView x:Name="stufftreeListView" AutoGenerateColumns="False"
                                 AutoExpandItems="True" GroupRenderMode="Flat" CanUserDeleteRows="False"
                                 ItemsSource="{Binding AllStaffByType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged }">
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding StaffCategories,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></telerik:TreeListViewTableDefinition>
            </telerik:RadTreeListView.ChildTableDefinitions>

            <telerik:RadTreeListView.Columns>
                <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsSelected}" AutoSelectOnEdit="True" EditTriggers="CellClick">
                    <telerik:EventToCommandBehavior.EventBindings>
                        <telerik:EventBinding Command="{Binding CustomCommandCommand}" EventName="MouseLeftButtonDown" />
                    </telerik:EventToCommandBehavior.EventBindings>
                </telerik:GridViewCheckBoxColumn>
                <telerik:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding Name}" Header="Stuff"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding AnnualSalary}" Header="Annual Salary"></telerik:GridViewDataColumn>
            </telerik:RadTreeListView.Columns>
        </telerik:RadTreeListView>
</UserControl>

 

I really do not know how to fix it.

Thanks

Andreea
Top achievements
Rank 1
Iron
 asked on 16 Jan 2024
1 answer
13 views

I need help with the node shape I have provided in the image. If this type of node can be drawn in your control , then can you please provide me with the code of the chart drawn in diagram control with the help of node (as per layout shown in attached png file) (include three or four nodes for the example).

I have tried to use it in custom shape but I didn't get any success.

I am using ui for WPF ( version latest ).

If you can help  me out with this problem  (as I have failed by other tool providers) then i might think of purchasing your product license soon.

Martin Ivanov
Telerik team
 answered on 03 Jan 2024
5 answers
140 views
Hi,
Is it posible to modify RadDiagramConnection to draw lines with 45, 90, 135, 180 ... degrees. Something like in Paint when I want to draw line, with shift button(showed in .gif). Gif from paint show what I want to do in RadDiagram using RadDiagramConnection
Robby
Top achievements
Rank 1
 updated answer on 16 Nov 2023
0 answers
24 views

I have this code in xaml:

 <telerik:RadDiagram
     x:Name="RadDiagram"
     primitives:BackgroundGrid.LineStroke="{DynamicResource SelmoBrushDiagramLineStroke}"
    ..../>

The problem is before the colors were predefined. It was a hex value.

Everytime I load the digram xml  with RadDiagram.Load(xml) the LineStroke has the hex color which was saved before in the serialzed xml and the new Dynamic Color doesn't get applied.

Is there any possibility to override the loaded diagram xml, or maybe set the the LineStroke in codebehind after loading the diagram xml?

Dan
Top achievements
Rank 1
Iron
 asked on 27 Oct 2023
0 answers
40 views

We have two situations:  one in which a ManipulationAdorner shows up, and one in which it does not.  I've determined that the sole difference, as far as I can tell, is the Visibility property on ManipulationAdorner itself.  In the one case, the Visibility is "Visible"; in the other, "Collapsed".

I see no other differences in this situation, including with DataContext and the styles/templates.  That is, in both cases, the DataContext has the same property values, and, in both cases, the styles/templates used are the same.

Visibility is being set locally, which means directly on the object either in xaml or in code.  We don't set Visibility directly ourselves, so I'm wondering whether there is logic internal to Diagram or ManipulationAdorner that sets the Visibility?  If so, what are the conditions that result in Visible vs Collapsed, please?  My hope is that I can work backwards from there to figure out how we're triggering the Collapsed state.

Thank you!

-David Marshburn

 

David
Top achievements
Rank 1
Iron
Iron
 asked on 31 Jul 2023
1 answer
26 views

Hello,

During project implementation a wrong link connection was found.

Precondition:

When we have two models of ContainerNodeViewModelBase OuterModel and InnerModel.

InnerModel has set to true "RadDiagramShapeBase.UseGlidingConnector".

Steps to reproduce:

1. Put InnerModel inside OuterModel.

2. Connect the top middle connector to middle connector of InnerModel

3. When you move InnerModel in upper part of OuterModel the link is connected to bottom of InnerModel instead of to top.

To make reproduce easier i attach video, and i modified your sample application (PasteOnMousePosition) to reproduce this issue.

I attached both things.

Video desc:
1st use case with no gliding connector -- looks ok

2nd use-case movement outside of container and the link looks ok, but the link connection inside looks bad.

Currently this link is just a line, but when it would be an arrow then its looks even worse.

Bartosz
Top achievements
Rank 1
Iron
 answered on 13 Jul 2023
1 answer
38 views

The problem I'm seeing is that text does scale up or down, just sometimes it seems to jump to a large size - is this a feature of RadDiagram? I note that if I set the scale back to 100%, the text is now much bigger. I've attached pictures to demonstrate.

now zoom out:

the text is bigger, to be readable? Now go back to 100%:

the text is now huge.

Pete
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 06 Feb 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?