I am not sure how you add the row shapes, but my guess the observed behavior in capture1.png is caused by the auto-resizing mechanism of RadDiagramContainerShape. Basically, the container is trying to always provide some margin between its borders and its children shapes. This is why if you position a shape withing this minimum distance (the margin), the container will be automatically resized.
To avoid this behavior I would suggest you couple of approaches.
- The first one is to make sure that the shape is added outside of the minimum distance. So for example if the X position of the table shape (the container shape) is at the 20th pixel, the child's X should be at least on the 30-40th pixel.
- The other approach is to override the CalculateContentBounds method in the TableShape class and return the original bounds. This way you'll avoid the auto-resizing mechanism. You can find some information about this in the following forum.
System.Windows.Rect CalculateContentBounds(System.Windows.Rect newShapeBounds)
About the OnItemsCollectionChanged, I checked this with the TableShape demo, but the method is called properly when you delete or add a row. I tested this using the Delete key and also the '+' and '-' buttons which are displayed when you click on the table shape's header.
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin
, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.