[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Reporting
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Gauges
  [Collapse]Vertical Grid
   [Expand]Product Information
   [Expand]ASPxVerticalGrid Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Expand]Focus and Navigation
    [Collapse]Data Editing
      Batch Edit Mode
      Adding and Deleting Records
      Record Validation and Error Indication
      Processing Custom Callbacks
    [Expand]Data Shaping and Manipulation
    [Expand]Data Formatting
     Appearance Customization
     Templates
    [Expand]Export
     Toolbars
    ASPxVerticalGrid Designer
   [Expand]Visual Elements
   [Expand]Member Tables
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [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]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

Adding and Deleting Records

Expanded Creating and Initializing New Records

End-users can create new records using the New command.

To allow end-users to add new records, create a command row, access the New command's settings by the ASPxVerticalGridCommandButtonSettings.NewButton property and set the VerticalGridCommandRow.ShowNewButton property to true.

To create records in code, use the client ASPxClientVerticalGrid.AddNewRecord method. This method switches the ASPxVerticalGrid to batch edit mode and allows the values of the new record to be edited.

To initialize record values in code, handle the ASPxVerticalGrid.InitNewRecord event.

Example:

In this example, the ASPxVerticalGrid.InitNewRecord event is handled to initialize the new record's field values with default values.

The image below shows the result:

Expanded Adding Records

To add a new record to the underlying data source, call the ASPxClientVerticalGrid.UpdateEdit (or ASPxClientVerticalGrid.UpdateEdit) method. End-users can do this by clicking the Save Changes button (the Update command).

You can also implement record validation. For information, see Record Validation and Error Indication.

After a new record has been added to ASPxVerticalGrid, the ASPxVerticalGrid.RecordInserted event is raised. To cancel the insert operation, handle the ASPxVerticalGrid.RecordInserting event.

Expanded Deleting Records

End-users can delete records using the Delete command. To do this in code, use the client ASPxClientVerticalGrid.DeleteRecord method.

After a record has been deleted, the ASPxVerticalGrid.RecordDeleted event is raised. To cancel the delete operation, handle the ASPxVerticalGrid.RecordDeleting event.

To allow an end-user to cancel the delete operation, enable the ASPxGridBehaviorSettings.ConfirmDelete option. In this case, when the user deletes a record, the Confirm Delete window is automatically displayed.

The text displayed within the Confirm Delete window can be specified using the ASPxGridTextSettings.ConfirmDelete property.

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