DiagramDataBindingControllerBase.GenerateConnector Event
Fires before generating a connector from the data source and allows you to customize it.
Namespace: DevExpress.XtraDiagram
Assembly: DevExpress.XtraDiagram.v24.2.dll
Declaration
Event Data
The GenerateConnector event's data class is DevExpress.XtraDiagram.DiagramGenerateConnectorEventArgs.
Remarks
By default, the uppermost connector defined in XAML within the DiagramDataBindingControllerBase.TemplateDiagram is used as the template for the connectors.
You can use the GenerateConnector event to implement custom logic for choosing the connector template. To do this, create connectors in the DiagramDataBindingControllerBase.TemplateDiagram and specify their names using the DiagramItem.TemplateName property. Specify the name of the desired template as the event’s CreateConnectorFromTemplate method parameter and assign the method return value to the event’s Connector property. See the example below.
private void DiagramDataBindingController_GenerateConnector(object sender, DiagramGenerateConnectorEventArgs e) {
if (e.DataObject is Link)
e.Connector = e.CreateConnectorFromTemplate("CurvedConnector");
else e.Connector = e.CreateConnectorFromTemplate("DefaultConnector");
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GenerateConnector event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.