Skip to main content
A newer version of this page is available. .

How to: Create a Simple Custom Item for the ASP.NET MVC Dashboard Extension

  • 4 minutes to read

This example shows you how to create a simple custom item displaying a list of dimension values. This item can be filtered by other master filter items and also contains one custom property that specifies whether to display the field header caption in the list.

To learn more information about the custom item creating, see Custom Item Creating.

wdd-custom-item

<!DOCTYPE html>

<html>
<head>
    <meta charset="UTF-8" />
    <title>@ViewBag.Title</title>

    @Html.DevExpress().GetStyleSheets( 
        new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
        new StyleSheet { ExtensionSuite = ExtensionSuite.Editors },
        new StyleSheet { ExtensionSuite = ExtensionSuite.Dashboard }
    )
    @Html.DevExpress().GetScripts( 
        new Script { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
        new Script { ExtensionSuite = ExtensionSuite.Editors },
        new Script { ExtensionSuite = ExtensionSuite.Dashboard }
    )
    <script>
        function onBeforeRender(sender) {
            var dashboardControl = sender.GetDashboardControl();
            dashboardControl.registerExtension(implementCustomExtension(dashboardControl));
        }
  </script>
</head>

<body>
    <div style="position: absolute; top: 0; bottom: 0; left: 0; right: 0">
        @RenderBody()
    </div>
    <script src="scripts/customExtension/icon.js"></script>
    <script src="scripts/customExtension/meta.js"></script>
    <script src="scripts/customExtension/viewer.js"></script>
    <script src="scripts/customExtension/customExtension.js"></script>
</body>
</html>