Dashboard Layout

Posted by: grapecity on 30 January 2019, 3:27 am EST

    • Post Options:
    • Link

    Posted 30 January 2019, 3:27 am EST

    Hello,

    God interest to use the dashboard and I am testing it now.

    How can I add controls (like flexgrid, flexchart) to the dashboard via code instead of using designer as most of our requirements are created at run-time.

    Thanks.

    Richards

  • Posted 30 January 2019, 3:29 am EST

    Sorry typo error it should be read as:

    Got interested to use…

  • Posted 31 January 2019, 2:03 am EST

    Hello,

    To add items like FlexGrid, FlexChart etc to the dashboard via code, you can make use of the Add method of the DashboardCollection class. The Add method accepts the id of the child container and a list of controls to place within the child container as parameters . These controls are then added to the child container/item container (Panel in case of Flow and Grid Layouts and C1SplitterPanel in case of Split Layout) which is created automatically by the Add method. For more information on this method please refer: https://help.grapecity.com/componentone/NetHelp/DashboardLayout/webframe.html#C1.Win.DashboardLayout.4~C1.Win.Layout.DashboardCollection~Add(String,IList).html

    The code snippet shown below depicts how you can add the FlexGrid control to the Dashboard. Similar approach can be used to add other controls as well.

    //Configure FlexGrid
                C1FlexGrid grid = new C1FlexGrid();
                grid.Dock = DockStyle.Fill;
                grid.DataSource = salesData;
    
     //Add child container containing FlexGrid
                DashboardItem dashboardGridItem =dashboard.Items.Add(Guid.NewGuid().ToString(), new List<Control>(){grid});
                dashboardGridItem.Caption = "Sales Details";
                Panel gridChildContainer=(Panel)dashboardGridItem.ItemContainer;
                gridChildContainer.Size = new Size(460, 300);
    

    Also, please find attached a sample(“AddingControlsToDashboard.zip”) which demonstrates how you can add FlexChart, FlexGrid etc to the dashboard.

    Hope it helps. Please let us know in case you have any other queries.

    AddingControlsToDashboard.zip

  • Posted 3 February 2019, 8:10 pm EST

    Hi,

    Thanks a lot!

    Richard

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels