Skip to content

DevExpress-Examples/winforms-dashboard-create-layout-from-scratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BI Dashboard for WinForms - How to Modify Dashboard Layout in Code

The following example demonstrates how to modify dashboard layout in code.

This example constructs the layout of a sample dashboard that contains the following items:

The Dashboard.LoadFromXml method loads a sample dashboard.

The following steps are taken to create a new layout:

  1. Create DashboardLayoutItem objects to display the existing dashboard items and DashboardLayoutGroup object to display a dashboard group. The weight parameter specifies the layout item's relative size in a group.
  2. Create DashboardLayoutGroup objects to organize items which do not belong to a dashboard group item. Add layout items as child nodes to form a layout tree.
  3. Create a root group - a new DashboardLayoutGroup object whose DashboardLayoutGroup.DashboardItem property is null. Add the layout tree nodes to the root as its child nodes.
  4. Assign the root group to the Dashboard.LayoutRoot property.

This example also demonstrates how to use the DashboardLayoutNode.MoveRight method to swap layout items, save and restore the layout with the SaveDashboardLayout and LoadDashboardLayout methods.

Files to Review

Documentation