/DashboardDifferentUserDataMVC

This example shows how to configure the Dashboard extension for MVC so that it loads data in the multi-user environment.

Primary LanguageJavaScriptOtherNOASSERTION

Dashboard for MVC - How to load different data based on the current user

This example shows how to configure the Dashboard control so that it loads data in the multi-user environment.

You can identify a user in the current session and handle the following events to select the underlying data source:

Files to Review

Example Structure

You can limit access to data depending on the current user's ID. This ID is stored in the HttpContext.Current.Session["CurrentUser"] value from session state.

When the application starts, you see the Index view with a ComboBox in which you can select a user. When you click the Sign in button, the ID of the selected user is passed to the HttpContext.Current.Session["CurrentUser"] variable and you are redirected to the Dashboard view. In this view, the Web Dashboard control displays the lists of dashboards and every dashboard loads data available to the selected user. Below is a table that illustrates the user IDs and their associated datasources in this example:

Role Sql Json Excel Object OLAP Extract Entity Framework
Admin Categories Customers Bikes Sales Customers Sales Categories
User Categories from different source with optional filter Customers from different source with optional filter Bikes from different source Sales from different source - - Categories from different source

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)