dashboard-400146-wpf-viewer-manage-dashboard-layout.md
The Dashboard Control allows users to resize dashboard items. You can also use the Dashboard API to maximize/restore dashboard items, load and save the layout.
Click and drag a separator line between items to resize them.
You can expand any dashboard item into the entire dashboard size to examine data in greater detail.
To maximize a dashboard item, click the Maximize button in the dashboard item caption.
To restore the item size, click the Restore button.
In code, use the following API members:
DashboardControl.MaximizedDashboardItemNameTo maximize a dashboard item in code, set MaximizedDashboardItemName to the dashboard item’s name. To restore the item, set MaximizedDashboardItemName to null.DashboardControlBase.AllowMaximizeDashboardItemsTo prevent a user from maximizing an item, set AllowMaximizeDashboardItems to false. This setting hides the Maximize item buttons for all items.
The control automatically stretches or shrinks content (dashboard items) in a dashboard to fit available screen space horizontally and vertically. You can adjust the layout options and specify exact content width and height:
The LayoutOptions property allows you to access the LayoutOptions object. You can use the Height and Width properties to adjust the dashboard layout. These properties return the LayoutDimensionOptions object that contains settings for the corresponding dimensions of the dashboard surface.
The LayoutDimensionOptions.Mode property allows you to specify whether a dashboard surface’s height or width is fixed or adjusted to fit its content:
AutoThe height or width of a dashboard surface fits to content.FixedThe height or width of a dashboard surface is set in pixels according to the LayoutDimensionOptions.Value property.
You can also mix layout modes for each dimension: for example, set the Auto value for width and Fixed for height to scroll dashboard layout vertically.
Use the following methods to save/load the dashboard layout to/from a stream or XML file.
DashboardControl.GetDashboardLayoutSaves dashboard layout to a string.DashboardControl.SetDashboardLayoutApplies dashboard layout contained in a string.DashboardControl.SaveDashboardLayoutSaves a dashboard layout (layout items and layout containers) to a stream.DashboardControl.LoadDashboardLayoutLoads a dashboard layout from a stream.DashboardControlBase.TitleCustomizationsTemplateAllows you to add, remove or modify command buttons and create drop-down menus in the dashboard title.