DashboardClientSideEvents.ItemWidgetCreated Property

Gets or sets the name of the JavaScript function or the entire code which will handle the client ASPxClientDashboardViewer.ItemWidgetCreated event.

Namespace: DevExpress.DashboardWeb

Assembly: DevExpress.Dashboard.v18.1.Web.WebForms.dll

Syntax

public string ItemWidgetCreated { get; set; }

Returns

Type Description
String

A string that is either the name of a JavaScript function or the entire JavaScript function code used to handle an event.

Examples

This example demonstrates how to customize client widgets used to visualize data within dashboard items at runtime using ASPxClientDashboardViewer's API.

The following options are changed:

using System.Web.Mvc;
using DevExpress.DashboardWeb.Mvc;
using DevExpress.DataAccess.ConnectionParameters;

namespace Dashboard_WidgetAccess_MVC.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        [ValidateInput(false)]
        public ActionResult DashboardViewerPartial() {
            return PartialView("_DashboardViewerPartial", DashboardViewerSettings.Model);
        }
        public FileStreamResult DashboardViewerPartialExport() {
            return DashboardViewerExtension.Export("DashboardViewer", DashboardViewerSettings.Model);
        }
    }
    class DashboardViewerSettings {
        public static DashboardSourceModel Model {
            get {
                DashboardSourceModel model = new DashboardSourceModel();
                model.DashboardSource = System.Web.Hosting.
                            HostingEnvironment.MapPath(@"~\App_Data\Dashboard.xml");

                model.ConfigureDataConnection = (sender, e) => {
                    if (e.ConnectionName == "nwindConnection") {
                        // Gets connection parameters used to establish a connection to the database.
                        Access97ConnectionParameters parameters =
                            (Access97ConnectionParameters)e.ConnectionParameters;
                        string databasePath =
                            System.Web.Hosting.HostingEnvironment.MapPath(@"~\App_Data\nwind.mdb");
                        // Specifies the path to a database file.  
                        parameters.FileName = databasePath;
                    }
                };
                return model;
            }
        }
    }

}