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
 [Expand]Common Concepts
 [Expand]ASP.NET WebForms Controls
 [Collapse]ASP.NET MVC Extensions
  [Expand]Product Information
  [Expand]Getting Started
  [Expand]Common Concepts
  [Collapse]Grid View
    Overview - GridView
    Main Features - GridView
   [Collapse]Concepts
    [Expand]Binding to Data
    [Collapse]Data Representation Basics
     [Expand]Cells
     [Collapse]Columns
       Data Columns
       Command Column
       Band Columns
       Unbound Columns
       Fixed Columns
     [Expand]Rows
      Customization Window
    [Expand]Focus and Navigation
    [Expand]Data Editing and Validation
    [Expand]Export Overview
   [Expand]Visual Elements
   [Expand]Examples
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]HTML Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Navigation and Layout Extensions
  [Expand]File Management
  [Expand]Multi-Use Site Extensions
  [Expand]Charts
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Tree List
  [Expand]Data Editor Extensions
  [Expand]Report Extensions
  [Expand]SpellChecker
 [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

Command Column

End-users can manipulate ASP.NET MVC GridView data via a command column. You can access command column settings via the GridViewSettings.CommandColumn property.

Expanded Commands

A command column is represented by the MVCxGridViewCommandColumn class. It provides a set of commands that allows end-users to switch the GridView to edit mode, and update data, delete rows, etc.

A command column allows multiple command items to be displayed within a cell. A single command is represented by a command item. There are eight command items.

By default, command items are represented by a link. They can also be represented by a button or image. Use the GridViewCommandColumn.ButtonType (via GridViewSettings.CommandColumn.ButtonType) property to specify how the command column renders its command items.

Example

The example below shows how to enable a command column with command buttons. In this example, the "New" button is placed within the column header and is represented as an image.

Partial View code:

The image below illustrates the result.

Expanded Behavior

End-users can move the command column to a different position within the grid (in relation to the other visible columns) or to the Customization Window by dragging its header. This is controlled by the column's GridViewCommandColumn.AllowDragDrop (via GridViewSettings.CommandColumn.AllowDragDrop) property. If this property is set to Default, the column behavior is controlled by the GridView's ASPxGridViewBehaviorSettings.AllowDragDrop (via GridViewSettings.SettingsBehavior.AllowDragDrop) option.

Expanded Custom Buttons

Command columns can display custom buttons within command cells. You can create your own buttons, and define custom actions for them.

Example

The example below shows how to create custom command buttons and define custom actions for them.

Controller code:

Partial View code ("_GridViewPartial"):

The image below illustrates the result.

Expanded See Also

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