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
   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]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]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

IntelliSense for Client API

From version v2010 vol.1 we provide IntelliSense support for the client-side API used in DevExpress ASP.NET Controls.

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

Powered by a (TypeScript based) JavaScript language service, Visual Studio 2017 provides improved JavaScript IntelliSense which can be based on information declared in TypeScript definition files (or .d.ts files). So, the easiest way to provide JavaScript IntelliSense for DevExpress client-side API in Visual Studio 2017 is to make a specific devexpress-web.d.ts definition file available within your project.

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

Note

You can also obtain this file by using options listed in this blog post.

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

Expanded Adding 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 entire IDE level in order to activate the JavaScript IntelliSense for all projects.

Note

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

Perform the following steps to register ASPxScriptIntelliSense.js in VS2012 and later versions.

  • In Visual Studio, open the “Tools -> Options -> Text Editor -> JavaScript -> IntelliSense -> References” dialog;
  • Choose the “Implicit (Web)” item in the “Reference Group” selector;
  • Click the “…” browse button near the “Add a reference to current group” textbox;
  • Select the “ASPxScriptIntelliSense.js” file (it is usually located in the installation directory in the "C:\Program Files (x86)\DevExpress 17.1\Components\Sources\DevExpress.Web.ASPxScriptIntelliSense" path);
  • Click the “OK” button to save changes.

Now, it is possible to browse the available DevExpress ASP.NET client-side types via the IDE IntelliSense.

Expanded Adding 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 into your web project using 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, you need to reference that file in the pages where you want to use IntelliSense (this can be a web page or a separate JavaScript file).

Note

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

  • Referencing within a web page

    In the page file, in which you want to enable IntelliSense for DevExpress Client-Side API, 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 helps prevent mixing up the IntelliSense schema classes and production scripts classes.

    You can now access DevExpress client API using IntelliSense.

  • Referencing within a separate JS file

    If you want to enable IntelliSense for our controls in a standalone .js file, simply add a reference to our ASPxScriptIntelliSense.js file at the top.

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

 

After you have added a reference to the ASPxScriptIntelliSense.js file, you have full IntelliSense support for our client controls. To enable IntelliSense for a particular DevExpress client object, you should make use of a specifically designed client Cast method.

Expanded Using the Cast method

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

The examples of this method application are:

  • Converting 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?​​​​​​​