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
  [Expand]Grid View
  [Expand]Card View
  [Collapse]Vertical Grid
    Overview - VerticalGrid
    Main Features
   [Collapse]Concepts
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Collapse]Data Editing and Validation
      Batch Editing
      Validation
    [Expand]Focus and Navigation
  [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

Batch Editing

The ASP.NET MVC VerticalGrid extension allows you to modify a batch of grid data on the client side and send it to the server in a single request. This topic describes how to enable batch data editing operations within your VerticalGrid.

Expanded Overview

In batch editing mode, the grid data contained in a page can be edited using in-line editors. All user changes are maintained on the client side until the Save changes button is clicked, or all changes are canceled by clicking the Cancel changes button.

To prevent an end-user from editing row cells, set the row's GridDataColumnSettings.ShowEditorInBatchEditMode property (using the MVCxVerticalGridRow.Settings.ShowEditorInBatchEditMode) to false. In this case, the row cells cannot be switched to edit mode. When an end-user navigates through cells using the TAB key, the row's cells are skipped.

If a grid contains modified data, it displays a "confirm" message before a grid callback is performed. You can customize the message text using the ASPxGridTextSettings.ConfirmOnLosingBatchChanges property (using VerticalGridSettings.SettingsText.ConfirmOnLosingBatchChanges), or you can disable it by setting the GridBatchEditSettings.ShowConfirmOnLosingChanges property (using VerticalGridSettings.SettingsEditing.BatchEditSettings.ShowConfirmOnLosingChanges) to false.

Expanded Enabling Batch Data Editing in the VerticalGrid

You can enable batch editing operations within the VerticalGrid using the following steps.

  1. Add a controller action method that will implement the following data record operations: add new records, save updated records and delete existing records within a data source.

    This controller action method obtains an MVCxGridViewBatchUpdateValues<T, S> object as a parameter. The MVCxGridViewBatchUpdateValues<T, S> object contains the following items.

    Item Description
    MVCxGridBatchUpdateValues<T, S>.DeleteKeys Contains a list of keys that correspond to grid records deleted on the client side in batch edit mode.
    MVCxGridBatchUpdateValues<T, S>.EditorErrors Provides an access to the dictionary of data source items and the corresponding ModelStateDictionary items.
    MVCxGridBatchUpdateValues<T, S>.Insert Contains a list of objects that are the grid records added on the client side in batch edit mode.
    MVCxGridBatchUpdateValues<T, S>.Update Contains a list of grid data items updated on the client side in batch edit mode.

    The action method should apply all changes obtained from the client side to the data source and return the VerticalGrid's Partial View.

    Controller code ("HomeController")

  2. Define the callback route values within the PartialView.

    Navigate to the Partial View that contains the VerticalGrid code. In the grid settings, define the callback route value to the action method (see the previous step) that will handle grid callbacks for batch data modification. To enable batch editing, set the ASPxVerticalGridEditingSettings.Mode property (using VerticalGridSettings.SettingsEditing.Mode) to Batch.

    Partial View code ("_VerticalGridPartial"):

  3. Enable the command row and command items.

    To allow end-users to manipulate grid data, add a command row to the grid's column collection and specify which commands (New, Delete) can be used by end-users.

    Partial View code ("_VerticalGridPartial")

Expanded Appearance Customization

You can customize the visual presentation of modified data items using the following settings available through the VerticalGridSettings.Styles property.

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