Issue: Child component(Diagram control) is not refreshing
In the child component, I've syncfusion diagram control. It binds well and no issues at the first time but when the data changes on the parent component which is not reflecting/refreshing on the child component. In fact, I've statehaschanged() method too on the parent but still the child component is not refreshing.
Additionally, I used blazor cascading parameter to pass the data changes to child component(diagram control) and syncfusion version 18.3.0.47
Attached the same with thread
Parent component: StockEnquiry.razor
Child component: StockDiagramHistory.razor
Approaches tried in code:
#1 statehaschanged() method in parent component - but still child component hasn't refreshed
#2 I've created method in the child component. Whenever the data changes, I passed to child's component method(internally this function calls OnInitialized method) but no luck
Could you please help.
Many thanks
Seetha.
|
public void Refresh(string Id)
{
Diagram.Clear();
NodeCollection.Add(NewNode("old Diagram","green")
ConnectorCollection.Add(NewConnecctor ("old Diagram","green")
} |
|
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddSyncfusionBlazor();
services.AddSingleton<HMIService>();
services.AddSingleton<MQService>();
services.AddServerSideBlazor().AddHubOptions(o =>
{
o.MaximumReceiveMessageSize = 102400000;
});
} |
|
public void Refresh(List<UnitTrackingHistory> cpDataset)
{
Diagram.Clear();
CPDataset = cpDataset;
if (CPDataset != null)
ConstructDiagramModel();
// to get automatic layout alignment
Diagram. DoLayout();
} |