Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Collapse]Common Concepts
  [Expand]Web.config Modifications
  [Expand]Callback Exception Handling
  [Collapse]Client-Side Functionality
    Client-Side Functionality Overview
    Client-Side API Availability for a Web Control
    Client-Side Events
   [Expand]Passing Values Between Client and Server Sides
    How to Register JavaScript on DevExpress Callbacks
    IntelliSense for Client API
  [Expand]Cookies Support
  [Expand]Appearance Customization - Theming
   Icon Collection
  [Expand]Performance Optimization
  [Expand]CSS Image Sprites
   Supported Document Types
  [Expand]Accessibility Support
   Right to Left Support
   HTML Encoding
   Binary Storage Configuration
  [Expand]SharePoint Support
   Touch Support
  [Expand]Office Document Management
   Cloud Storage Account Management
  [Expand]Web Farm and Web Garden Support
 [Expand]ASP.NET WebForms Controls
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

IntelliSense for Client API

DevExpress ASP.NET ASP.NET Controls provide IntelliSense support for the client-side API (for DevExpress controls v10.1 and higher).

Expanded Add IntelliSense support for the client-side API to Visual Studio 2017

Visual Studio 2017 provides improved JavaScript IntelliSense support powered by a JavaScript language service based on information declared in TypeScript definition files (or .d.ts files).

Add a devexpress-web.d.ts definition file to your project to provide JavaScript IntelliSense support for client-side API.

This file is usually located in the following folder after installation:
C:\Program Files (x86)\DevExpress 17.2\Components\Sources\DevExpress.Web.ASPxScriptIntelliSense

Note

You can also obtain this file via options listed in the Use TypeScript with DevExpress ASP.NET and MVC Controls (v16.1) blog post.

After adding the devexpress-web.d.ts file, you can enable IntelliSense for a specific DevExpress client object by calling its client Cast method (see the section below).

Expanded Add IntelliSense support for the client-side API to Visual Studio 2012 and later versions

Starting with Visual Studio 2012, it is possible to register the ASPxScriptIntelliSense.js file at the IDE level to activate JavaScript IntelliSense for all projects.

Note

The ASPxScriptIntelliSense.js file is available when Source Code is installed during the DevExpress installation.

Register ASPxScriptIntelliSense.js as detailed below.

  • In Visual Studio, select Tools -> Options -> Text Editor -> JavaScript -> IntelliSense -> References;
  • In the invoked dialog, choose the Implicit (Web) item in the Reference Group selector;
  • Click the ellipsis (“…”) button next to the Add a reference to current group textbox;
  • Select the ASPxScriptIntelliSense.js file (usually located in the "C:\Program Files (x86)\DevExpress 17.2\Components\Sources\DevExpress.Web.ASPxScriptIntelliSense" path);
  • Click the OK to save changes.

It is now possible to browse available DevExpress ASP.NET client-side types via the IntelliSense.

Expanded Add IntelliSense support for the client-side API to Visual Studio 2008-2013

If you wish to add IntelliSense support, add the ASPxScriptIntelliSense.js service file to your web project via the Add Existing Item... dialog. This file is located in the <DevExpress>\Sources\DevExpress.Web.ASPxScriptIntelliSense folder after installation. Once the file has been added, reference that file in the pages in which you require IntelliSense (this can be a web page or a separate JavaScript file).

Note

The ASPxScriptIntelliSense.js file is available when Source Code is installed during the DevExpress installation.

  • Referencing within a web page

    To enable IntelliSense for the DevExpress client-side API within a page file, insert the following code in the page's BODY section:

    It is important to use the 'if(DesignMode)' condition, because it helps avoid additional round trips to the server for the ASPxScriptIntellisense.js file, and prevents the mixing of IntelliSense schema classes and production scripts classes.

    You can now access DevExpress client API using IntelliSense.

  • Referencing within a separate JS file

    To enable IntelliSense for DevExpress controls in a standalone .js file, add a reference to the ASPxScriptIntelliSense.js file at the beginning of the JavaScript file.

    You now have IntelliSense support for the DevExpress client API in a standalone JavaScript file.

 

Once you have added a reference to the ASPxScriptIntelliSense.js file, you have full IntelliSense support for DevExpress client controls. Use the specially designed client Cast method to enable IntelliSense for a specific DevExpress client object.

Expanded How to use the Cast method

We have added special static Cast methods that allow you to indicate the type of a client-side control instance, which enables IntelliSense for this type.

The examples of this method application are:

  • Convert the event source object passed to a client event's handler.

  • Converting a client object, which is accessed by using the value of the ClientInstanceName (or ID) property. For instance, if an ASPxGridView control's ClientInstanceName property is set to 'grid', the object can be type cast in the following manner:

How would you rate this topic?​​​​​​​