[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]ASP.NET WebForms Controls
 [Collapse]ASP.NET MVC Extensions
  [Expand]Product Information
  [Expand]Getting Started
  [Collapse]Common Concepts
    Web Application Project Templates
    Insert Extension Wizard
    Data Binding
   [Expand]Applying Themes
    Client-Side API
    Declaring Server-Side Event Handlers
    Templates
    Using Callbacks
    Passing Values to a Controller Action through Callbacks
    Supported Attributes for Model Validation
    Using Extensions in Razor Views
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Reporting
  [Expand]Charting
  [Expand]Pivot Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Vertical Grid
  [Expand]Data Editors Extensions
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Extensions
  [Expand]SpellChecker
  [Expand]Query Builder
 [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]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Declaring Server-Side Event Handlers

Certain DevExpress ASP.NET MVC extensions expose event-driven functionality, allowing you to respond to certain stages of component creation and rendering. By handling these events, which are based on the delegate model, you can control and customize the default rendering of an extension.

The code example below demonstrates how to define the server event handler. In this example, the Menu's MenuSettingsBase.ItemDataBound event is processed.

View:

Expanded Accessing the Wrapped ASP.NET WebForms Control

The DevExpress ASP.NET MVC extensions are the wrappers of DevExpress ASP.NET WebForms controls. These wrappers are designed to follow the MVC pattern and seamlessly integrate into ASP.NET MVC projects.

When a DevExpress ASP.NET MVC extension is configured and bound to data (if available), the extension's instance is represented by the MVCx[ExtensionName] class. This class is a descendant of the corresponding DevExpress ASP.NET WebForms control, for example, the MVCxGridView class is a descendant of ASPxGridView.

You can access the wrapped control by handling the SettingsBase.PreRender or the SettingsBase.Init server event. The event sender is the corresponding MVCx[ExtensionName] object. Using the MVCx[ExtensionName] objects can be useful for modifying extension behavior if the behavior depends on data items displayed within the extension. If extension behavior does not depend on data, it is recommended that you modify the behavior using the [ExtensionName]Settings object.

Example

The code sample below demonstrates how to access the MVCxGridView object and expand the first detail row when the grid is initially displayed in a page.

Is this topic helpful?​​​​​​​