HOW TO Dashboard panel save in db & save load panel property dashboard add ?


It is being developed in the form of adding a panel to the layout when loading it after saving it in the panel property database. If the number of panels is more than two, a problem occurs in the panel control. Is there a workaround?

SAVE
public async Task SaveClick(EventArgs args) { bool isDelete = false; string ContentValue = "Chart" + Count; for (int i = 0; i < dashboardObject.Panels.Count; i++) { if (!isDelete) { await DashBoardService.DeleteAllDashBoardDetail(Convert.ToInt32(UserInfo.SiteId)); isDelete = true; } DashBoardData.LayerID = dashboardObject.ID; DashBoardData.PanelID = dashboardObject.Panels[i].Id; DashBoardData.SizeX = dashboardObject.Panels[i].SizeX; DashBoardData.SizeY = dashboardObject.Panels[i].SizeY; DashBoardData.RowNum = dashboardObject.Panels[i].Row; DashBoardData.ColNum = dashboardObject.Panels[i].Col; DashBoardData.SiteID = Convert.ToInt32(UserInfo.SiteId); await DashBoardService.InsertDashBoard(DashBoardData); } }
 
LOAD
if (DashBoardList.Count > 0)
        {
            for (int i = 0; i < DashBoardList.Count; i++)
            {
                if (DashBoardList[i].LayerID != null)
                {
                    RenderFragment CreateDynamicComponent() => builder =>
                    {
                        builder.OpenComponent(0, typeof(ChartEx));
                        builder.CloseComponent();
                    };
                    string tets = DashBoardList[i].PanelID;
                    PanelModel panel = new PanelModel
                    {
                        Id = DashBoardList[i].PanelID,
                        SizeX = DashBoardList[i].SizeX,
                        SizeY = DashBoardList[i].SizeY,
                        Col = DashBoardList[i].ColNum,
                        Row = DashBoardList[i].RowNum,
                        Enabled = false
                    };
                    dashboardObject.AddPanel(panel);
                }
            }
        }

3 Replies 1 reply marked as answer

MK Muthukrishnan Kandasamy Syncfusion Team November 18, 2020 12:31 PM UTC

 
Hi Jin, 
 
Thanks for contacting Syncfusion support. 
 
We have looked into your query on Dashboard Layout. In DashboardLayout component, using this serialize() method, you can get the only the panel position properties ( SizeX, SizeY, Row, Col, Id ).  
The current layout structure of the Dashboard Layout component can be obtained and saved to construct another dashboard with same panel structure using the serialize public method of the component. This method returns the component’s current panel setting which can be used to construct a dashboard with the same layout settings. 
 
Since, content within the panels will vary based on the different user’s need and it might be any HTML elements regardless of Syncfusion controls, we cannot determine the content inside the dashboard panels and their respective configurations. So, we have no in-built functionality in Dashboard Layout to handle the content inside the panels. Therefore, we suggest you to manually save the panel content from the components in your application. 
 
Please, check out the following links to know more about SF Dashboard Layout. 
 
 
 
 
 
Please, let us know if you have any concerns. 
 
Regards, 
Muthukrishnan K 



AL Alain replied to Muthukrishnan Kandasamy April 22, 2021 03:11 PM UTC

 
Hi Jin, 
 
Thanks for contacting Syncfusion support. 
 
We have looked into your query on Dashboard Layout. In DashboardLayout component, using this serialize() method, you can get the only the panel position properties ( SizeX, SizeY, Row, Col, Id ).  
The current layout structure of the Dashboard Layout component can be obtained and saved to construct another dashboard with same panel structure using the serialize public method of the component. This method returns the component’s current panel setting which can be used to construct a dashboard with the same layout settings. 
 
Since, content within the panels will vary based on the different user’s need and it might be any HTML elements regardless of Syncfusion controls, we cannot determine the content inside the dashboard panels and their respective configurations. So, we have no in-built functionality in Dashboard Layout to handle the content inside the panels. Therefore, we suggest you to manually save the panel content from the components in your application. 
 
Please, check out the following links to know more about SF Dashboard Layout. 
 
 
 
 
 
Please, let us know if you have any concerns. 
 
Regards, 
Muthukrishnan K 


Hi,

Thanks for your advice. Can you provide some more information about populating in content? I have a few dashboard panels with blazor components as contents containing syncfusion graphs. What's the best way to do this?

Al.


SS Sharon Sanchez Selvaraj Syncfusion Team April 23, 2021 12:18 PM UTC

Hi Alain, 
 
We have checked with your requirement. And inorder to populate the content of the panels, we have provided a simple example wherein we modify the content of a panel through a simple button click. 
 
Over here, we’ve initialized the panel content of the Bullet Chart. And using a button click, the content is cleared. And we’ve populated the content by dynamically rendering it again. 
 
Refer to the code snippet: 
 
public void update() 
    { 
        ContentValue =@<SfButton>Content Updated</SfButton>; 
    } 
 
Refer to the sample. 
 
 
Please get back to us if you need further assistance. 
 
Regards, 
 
Sharon Sanchez S. 


Marked as answer
Loader.
Up arrow icon