RadDiagramConnection not binding on RadTabItems tabs after 1st tab

1 Answer 71 Views
Diagram TabControl
Devon
Top achievements
Rank 2
Devon asked on 01 Jun 2021, 04:00 PM

Hi,

I am having an issue with RadDiagramConnections not binding from the source to the target on RadTabItems after the 1st tab. Here is my UserControl layout.

  1. I have UserControl with a RadTabControl with 2 RadTabItems.
  2. Each RadTabItem contains a RadDiagram (each with multiple RadDiagramShapes and RadDiagramConnections).

The 1st RadTabItem Diagram loads as it should (no issues). The 2nd RadTabItem diagram only loads the shapes and not the connections. During initialization of the software, Visual Studio Output window shows "Cannot find source for binding with reference" for all of the connections on the 2nd diagram. How do I get the Connections to load properly? 

1 Answer, 1 is accepted

Sort by
1
Martin Ivanov
Telerik team
answered on 02 Jun 2021, 06:39 AM

Hello Devon,

The issue appears because of a combination between the tab control's content loading mechanism and the default setup of the diagram shown across the help documentation. Basically, the tab control's logical tree is initialized when the view is loaded, however the visual tree of the unselected tabs is not loaded. This means that the ElementName bindings kicks-in but it cannot find the corresponding elements because they are not in the visual tree. This behavior can be observed also with the WPF native TabControl.

To resolve the issue, you can use the x:Reference keyword instead of ElementName for the Target and Source bindings of the connection. For example:

Source="{Binding Source={x:Reference ConditionShape}}" 

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Devon
Top achievements
Rank 2
commented on 03 Jun 2021, 07:26 PM

Hello Martin! Thank you for the suggestion. It worked perfect.
Tags
Diagram TabControl
Asked by
Devon
Top achievements
Rank 2
Answers by
Martin Ivanov
Telerik team
Share this question
or