## The Goal
To change the Diagram's subtree alignment at runtime.
Note: This functionality is demonstrated in the blazor-samples app on the `/diagram/organization-model` page.
## What I did
1. Create a standard Blazor server side app. (SfBSS-OrgChart)
2. From the Syncfusion blazor-samples folder, copy the file `Demos\Blazor\220.127.116.11\Pages\Diagram\Diagram\OrganizationModel.razor` to the `SfBSS-OrgChart` project's `pages` folder.
3. In `OrganizationModel.razor` comment out `@inherits SampleBaseComponent;` (line 9) (otherwise it won't compile).
4. Set the page routes to this page.
5. Build and run.
6. Navigate to the `/diagram/organization-model` page.
7. In the Subtree Alignment options, Click on the "Center" option.
## Expected behaviour
I expect the diagram to change with the subtree's now center aligned.
## Observed behaviour
The diagram does not change the subtree alignment.
Build both applications (`SfBSS-OrgChart` and `blazor-samples`) with identical setup.
- Visual Studio: Version 16.6.0 Preview 2.1
- Dotnet: 3.1.300-preview-015048
Run both applications side-by-side. Then, in both apps perform the following steps.
1. Set a breakpoint on the `Pattern7Click()` event handler (line 473)
2. Navigate to the `/diagram/organization-model` page.
3. In the Subtree Alignment options, Click on the "Center" option.
4. In the debug window, inspect the Diagram.Nodes variable on line 474. (see included screen captures)
In the blazor-samples app, the Diagram.Nodes variable has 19 elements (count=19)
In the SfBSS-OrgChart app, the Diagram.Nodes variable has zero elements. (count=0)
Obviously this is why the SfBSS-OrgChart's subtree alignment is not working because there are no Diagram.Nodes to iterate over !
Q1: Can you explain why this happens ? The code is identical to your demo except for the `@inherits SampleBaseComponent;` line.
Q2: Where does the Nodes array get populated ? If I knew this I could probably figure out why it's empty.
Zip file with the `SfBSS-OrgChart` project and two images.