New to Telerik UI for WinForms? Start a free 30-day trial

Binds shape and connection records to diagram items, mapping configured data members to their visual properties.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public class DiagramDataLayer : INotifyPropertyChanged

Inheritance: objectDiagramDataLayer

Implements: INotifyPropertyChanged

Constructors

Initializes the data layer for the specified diagram element and installs the default element provider.

C#
public DiagramDataLayer(RadDiagramElement diagramElement)
Parameters:diagramElementRadDiagramElement

The diagram element whose shapes and connections are populated from the data source.

Properties

Gets or sets the links data member.

C#
[Browsable(true)]
public string ConnectionDataMember { get; set; }
Property Value:

The data member.

Gets or sets the currency manager for the collection selected by ConnectionDataMember.

C#
public CurrencyManager ConnectionsCurrencyManager { get; set; }

Gets or sets the ConnectionSourceCapTypeMember data member.

C#
[Browsable(true)]
public string ConnectionSourceCapTypeMember { get; set; }
Property Value:

The data member.

Gets or sets the SourceConnector data member.

C#
[Browsable(true)]
public string ConnectionSourceConnectorMember { get; set; }
Property Value:

The data member.

Gets or sets the ConnectionTargetShapeIdMember data member.

C#
public string ConnectionSourceShapeIdMember { get; set; }
Property Value:

The data member.

Gets or sets the ConnectionTargetCapTypeMember data member.

C#
[Browsable(true)]
public string ConnectionTargetCapTypeMember { get; set; }
Property Value:

The data member.

Gets or sets the Target connector data member.

C#
[Browsable(true)]
public string ConnectionTargetConnectorMember { get; set; }
Property Value:

The data member.

Gets or sets the ConnectionTargetShapeIdMember data member.

C#
[Browsable(true)]
public string ConnectionTargetShapeIdMember { get; set; }
Property Value:

The data member.

Gets or sets the SourceConnector data member.

C#
[Browsable(true)]
public string ConnectionTextMember { get; set; }
Property Value:

The data member.

Gets or sets the data source of the RadDiagram/>.

C#
[Browsable(false)]
public object DataSource { get; set; }

Gets or sets the provider used to create the shape and connection elements for bound records.

C#
public virtual IDiagramDataLayerElementProvider ElementFactory { get; set; }

Gets a value indicating whether this instance is data bound.

C#
public bool IsDataBound { get; }
Property Value:

true if this instance is data bound; otherwise, false.

Gets or sets the links data member.

C#
[Browsable(true)]
public string ShapeDataMember { get; set; }
Property Value:

The data member.

Gets or sets the Shape height data member.

C#
[Browsable(true)]
public string ShapeHeightMember { get; set; }
Property Value:

The data member.

Gets or sets the ID data member.

C#
[Browsable(true)]
public string ShapeIdMember { get; set; }
Property Value:

The data member.

Gets or sets the currency manager for the collection selected by ShapeDataMember.

C#
public CurrencyManager ShapesCurrencyManager { get; set; }

Gets or sets the links data member.

C#
[Browsable(true)]
public string ShapeTextMember { get; set; }
Property Value:

The data member.

Gets or sets the Shape data member.

C#
[Browsable(true)]
public string ShapeTypeMember { get; set; }
Property Value:

The data member.

Gets or sets the Shape height data member.

C#
[Browsable(true)]
public string ShapeWidthMember { get; set; }
Property Value:

The data member.

Gets or sets the Shape X position data member.

C#
[Browsable(true)]
public string ShapeXMember { get; set; }
Property Value:

The data member.

Gets or sets the Shape Y position data member.

C#
[Browsable(true)]
public string ShapeYMember { get; set; }
Property Value:

The data member.

Methods

Creates a connection for dataItem and synchronizes its configured properties from that record.

C#
protected virtual RadDiagramConnection CreateDiagramConnectionItem(object dataItem)
Parameters:dataItemobject

The source record represented by the connection.

Returns:

RadDiagramConnection

The synchronized connection, or null when no mapped connection property can be applied.

Creates a shape for dataItem and synchronizes its configured properties from that record.

C#
protected virtual RadDiagramItem CreateDiagramShapeItem(object dataItem)
Parameters:dataItemobject

The source record represented by the shape.

Returns:

RadDiagramItem

The synchronized shape, or null when no mapped shape property can be applied.

Recreates the diagram items from the current shape and connection lists and synchronizes selection with the shape currency manager.

C#
protected virtual void DataManagerItemChanged()

Reads the named data-member value through its property descriptor while the data layer is bound.

C#
public object GetBoundValue(object dataBoundItem, string propertyName, PropertyDescriptorCollection properties)
Parameters:dataBoundItemobject

The source record to read.

propertyNamestring

The member name configured for the diagram property.

propertiesPropertyDescriptorCollection

The descriptors available for the source record type.

Returns:

object

The member value. Returns null when the layer is unbound, the member is missing, or a non-enum getter throws. Enum-valued members are converted to their enum type.

Exceptions: ArgumentNullException

An enum-typed member produces a null value, including when its getter throws.

Raises ItemDataBound after a source record has been synchronized with a diagram item.

C#
protected virtual void OnItemDataBound(DiagramItemDataBoundEventArgs e)
Parameters:eDiagramItemDataBoundEventArgs

The source record and synchronized diagram item.

Rebinds the current source before raising PropertyChanged for the changed data-layer property.

C#
protected virtual void OnPropertyChanged(string propertyName)
Parameters:propertyNamestring

The name reported to property-change subscribers.

Reinitializes binding for newDataSource, rebuilding diagram items when its shape or connection lists are available.

C#
public void Rebind(object newDataSource)
Parameters:newDataSourceobject

The source that provides the shape and connection records.

Writes value to the named data member when the layer is bound and the member descriptor exists.

C#
public void SetBoundValue(object dataBoundItem, string propertyName, object value, PropertyDescriptorCollection properties)
Parameters:dataBoundItemobject

The source record to update.

propertyNamestring

The member name configured for the diagram property.

valueobject

The value to write to the source record.

propertiesPropertyDescriptorCollection

The descriptors available for the source record type.

If the layer is unbound, the member descriptor is missing, or its setter throws, this method does not report a failure.

Creates connection elements for records in items and adds successfully mapped connections to the diagram.

C#
protected virtual void SetConnectiosPropetiesCore(IList items)
Parameters:itemsIList

The connection records supplied by the bound list.

Creates shape elements for records in items and adds successfully mapped shapes to the diagram.

C#
protected virtual void SetShapesPropertiesCore(IList items)
Parameters:itemsIList

The shape records supplied by the bound list.

Events

Occurs after a source record has been synchronized with a diagram shape or connection.

C#
public event DiagramItemDataBindingEventHandler ItemDataBound

Occurs after a data-layer property changes. Updating a binding member also rebinds the current data source.

C#
public event PropertyChangedEventHandler PropertyChanged

Implements: INotifyPropertyChanged.PropertyChanged