This tutorial demonstrates how to use UI for WPF in the content of a RadDiagramShape component.

As the RadDiagramShape essentially derives from a ContentControl, its Content can wrap other controls. For the purpose of this tutorial we will use a RadCalendar and a RadGridView and will display both in RadDiagramShapes. We will also connect these shapes with a RadDiagramConnection.

Public Class ProductSales
Public Sub New(quantity As Integer, month As Integer, monthName As String)
Me.Quantity = quantity
Me.Month = month
Me.MonthName = monthName
End Sub
Public Property Quantity() As Integer
Get
Return m_Quantity
End Get
Set(value As Integer)
m_Quantity = Value
End Set
End Property
Private m_Quantity As Integer
Public Property Month() As Integer
Get
Return m_Month
End Get
Set(value As Integer)
m_Month = Value
End Set
End Property
Private m_Month As Integer
Public Property MonthName() As String
Get
Return m_MonthName
End Get
Set(value As String)
m_MonthName = Value
End Set
End Property
Private m_MonthName As String
End Class

Next in our code-behind we can create a method that returns a list of ProductSales and use its result as a DataContext of the view:

Now if we run the solution we will have a populated RadGridView control inside the RadDiagramShape.

We can also define a shape in the code-behind file and set its content to any RadControl. Please have a look at the example below as it demonstrates how to create a RadDiagramShape and use a RadCalendar in its Content:

Was this article helpful?

/

Give article feedback

Tell us how we can improve this article

Code samples are inaccurate / outdated.
I expected to find other / more information.
There are typos / broken links / broken page elements.
Content is inaccurate / outdated.
Other
By checking this box you consent to Progress contacting you by email about your response on this page.

Community

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.