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
    [Expand]Data Editing and Validation
    [Collapse]Focus and Navigation
     [Expand]Paging and Scrolling
      Selection
  [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

Selection

This topic describes the concept of column selection, including an overview of the selection functionality, as well as how to process selected records on the client and server sides.

Expanded Selection Overview

VerticalGrid allows end-users to select columns using the following methods.

The style settings used to paint selected records can be accessed and customized using the VerticalGridStyles.SelectedRecord (through VerticalGridSettings.Styles.SelectedRecord) property.

Expanded Processing Selected Records on the Client Side

VerticalGrid provides a full-featured client-side API that allows you to select and deselect records using JS code. The table below lists the available selection-related methods.

Method Description
ASPxClientVerticalGrid.GetSelectedFieldValues (through MVCxClientVerticalGrid.GetSelectedFieldValues) Returns the record values displayed within all selected records.
ASPxClientVerticalGrid.GetSelectedKeysOnPage (through MVCxClientVerticalGrid.GetSelectedKeysOnPage) Returns key values of selected records displayed within the current page.
ASPxClientVerticalGrid.GetSelectedRecordCount (through MVCxClientVerticalGrid.GetSelectedRecordCount) Returns the number of selected records.
ASPxClientVerticalGrid.IsRecordSelectedOnPage (through MVCxClientVerticalGrid.IsRecordSelectedOnPage) Indicates whether or not the specified record is selected within the current page.
ASPxClientVerticalGrid.SelectAllRecordsOnPage (through MVCxClientVerticalGrid.SelectAllRecordsOnPage) Allows you to select or deselect all records displayed on the current page based on the parameter passed.
ASPxClientVerticalGrid.SelectRecordOnPage (through MVCxClientVerticalGrid.SelectRecordOnPage) Selects the specified record displayed on the current page.
ASPxClientVerticalGrid.SelectRecords (through MVCxClientVerticalGrid.SelectRecords) Selects or deselects the specified record within the grid.
ASPxClientVerticalGrid.SelectRecordsByKey (through MVCxClientVerticalGrid.SelectRecordsByKey) Selects or deselects the specified records displayed within the grid.
ASPxClientVerticalGrid.UnselectAllRecordsOnPage (through MVCxClientVerticalGrid.UnselectAllRecordsOnPage) Deselects all selected records displayed on the current page.
ASPxClientVerticalGrid.UnselectFilteredRecords (through MVCxClientVerticalGrid.UnselectFilteredRecords) Deselects all grid records that match the filter criteria currently applied to the grid.
ASPxClientVerticalGrid.UnselectRecordOnPage (through MVCxClientVerticalGrid.UnselectRecordOnPage) Deselects the specified record (if selected) displayed on the current page.
ASPxClientVerticalGrid.UnselectRecords (through MVCxClientVerticalGrid.UnselectRecords) Deselects the specified record (if selected) within the grid.
ASPxClientVerticalGrid.UnselectRecordsByKey (through MVCxClientVerticalGrid.UnselectRecordsByKey) Deselects the specified record displayed within the grid.

Example

In this example, the ASPxClientVerticalGrid.SelectionChanged (through MVCxClientVerticalGrid.SelectionChanged) client-side event is handled to display selected contacts within a list box. Contact names are obtained using the ASPxClientVerticalGrid.GetSelectedFieldValues (through MVCxClientVerticalGrid.GetSelectedFieldValues ) function.

View code:

Partial View code:

The image below illustrates the result:

Expanded Processing Selected Rows on the Server Side

To obtain the selected rows on the server side, you should get the selected rows on the client-side and then send them to the server via a callback.

Example

In this example, the ASPxClientVerticalGrid.SelectionChanged (through MVCxClientVerticalGrid.SelectionChanged) client-side event is handled to get a collection of selected values and send them to the server side using a callback. Contact names and cities are obtained using the ASPxClientVerticalGrid.GetSelectedFieldValues (through MVCxClientVerticalGrid.GetSelectedFieldValues ) function, and are passed to the OnGetValues function. The OnGetValues function concatenates the selected values to a single string and sends the resulting string to the server using the MVCxClientVerticalGrid.PerformCallback method. In the controller code, you can split the string into separate values.

View code:

Partial View code:

Controller code:

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