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

Displaying a connector label when using DataTemplates

2 Answers 95 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
kilhoffer
Top achievements
Rank 1
kilhoffer asked on 21 Feb 2012, 07:58 AM
I'm using DataTemplates to build out my nodes, very similar to how it's done in the OrgChart example. I now need to have the connector lines to display a label. How is this done when using a template?

2 Answers, 1 is accepted

Sort by
0
Accepted
Miro Miroslavov
Telerik team
answered on 21 Feb 2012, 08:08 AM
Hello,

 You can use the same approach as with the Shapes. First define your DataTemplate.

<DataTemplate x:Key="ConnectionTemplate">
 <TextBlock Text="{Binding Text}" />
</DataTemplate>

and then just set it to the Diagram. 
<telerik:RadDiagram x:Name="diagram" ConnectionTemplate="{StaticResource ConnectionTemplate}" />

Hope this is what you need.

Greetings,
Miro Miroslavov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
kilhoffer
Top achievements
Rank 1
answered on 21 Feb 2012, 08:12 AM
Perfect. Thank you!
Tags
Diagram
Asked by
kilhoffer
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
kilhoffer
Top achievements
Rank 1
Share this question
or