Hi!
When creating a diagram with too many items with AutoLayout, it seems there is a maximum width the diagram will grow to.
Which causes a weird behavior of the items being places vertically.
Is it possible to set the width of the available space for the auto layout?
I've added a screenshot demonstrating the behavior.
Thanks!
4 Answers, 1 is accepted
0
Hello Tulio,
Please check out the settings you can apply to Diagram Layout:
Diagram Layout Settings
ComponentsGridWidth should be the property you need. Please let us know if it works well for your scenario or not.
Regards,
Petar Mladenov
Progress Telerik
Please check out the settings you can apply to Diagram Layout:
Diagram Layout Settings
ComponentsGridWidth should be the property you need. Please let us know if it works well for your scenario or not.
Regards,
Petar Mladenov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0

Tulio
Top achievements
Rank 1
answered on 19 Mar 2019, 06:06 PM
Hi Petar,
I could not make it work with AutoLayout set to true though. I can see that this works fine if you don't have AutoLayout, but for my scenario I would like to be able to use AutoLayout. Is it possible?
0
Hello Tulio,
Yes, the auto layout feature invokes the layout with default null settings. However, it should be easy to implement auto layout logic on your own:
- use the ItemsChanged event or ContainerGenerator.StatusChanged (with ContainersGenerated status) events of the RadDiagram and invoke LayoutAsync method with your custom settings. This is basically what auto layout does internally
- there is a private fields in RadDiagram:
If you invoke LayoutAsync with custom settings, they are assigned to the mentioned field:
And if AutoLayout is true, these settings are used for auto layout. So basically, you can combine single invocation of LayoutAsync early in your application and set AutoLayout true.
Regards,
Petar Mladenov
Progress Telerik
Yes, the auto layout feature invokes the layout with default null settings. However, it should be easy to implement auto layout logic on your own:
- use the ItemsChanged event or ContainerGenerator.StatusChanged (with ContainersGenerated status) events of the RadDiagram and invoke LayoutAsync method with your custom settings. This is basically what auto layout does internally
- there is a private fields in RadDiagram:
private object asyncLayoutSettings = null;
If you invoke LayoutAsync with custom settings, they are assigned to the mentioned field:
public
void
LayoutAsync(LayoutType type = LayoutType.Sugiyama,
object
settings =
null
)
{
this
.asyncLayoutType = type;
this
.asyncLayoutSettings = settings;
this
.shouldLayout =
true
;
}
And if AutoLayout is true, these settings are used for auto layout. So basically, you can combine single invocation of LayoutAsync early in your application and set AutoLayout true.
Regards,
Petar Mladenov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0

Tulio
Top achievements
Rank 1
answered on 22 Mar 2019, 07:05 PM
It works!
Thanks for the help!