Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Binding to Data
   [Expand]Grid View
   [Expand]View Technology
   [Expand]Grouping
   [Expand]Sorting
   [Expand]Summaries
   [Collapse]Data Editing
    [Expand]Edit Form
    [Expand]Editing via Code
    [Collapse]In-place Editors
      In-place Editors Overview
      Assigning Editors for In-Place Editing
      Assigning Editors to Columns and Card Fields
      Assigning Editors to Individual Cells
      Showing and Hiding Editors
    [Expand]Input Validation
    [Expand]New Item Row
     Tutorial: Add or Remove Rows
     Tutorial: Data Input Validation
   [Expand]Filtering and Locating Rows
   [Expand]Focus and Selection Handling
   [Expand]Processing Rows
   [Expand]Formatting Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Expand]Appearance and Conditional Formatting
   [Expand]Batch Modifications
   [Expand]Hit Information
   [Expand]Hints
   [Expand]Popup Menus
   [Expand]Saving and Restoring Layouts
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[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

Assigning Editors to Columns and Card Fields

Since columns and card fields represent data fields that typically contain values of the same type, it is common practice to use a single editor for all cells in a column or card field. This topic explains how to bind editors to columns and card fields.

For Grid Views, it is also possible to specify different editors for different cells in a column. Refer to the Assigning Editors to Individual Cells topic for more information. Also refer to the In-place Editors Overview topic, which describes the repository mechanism used to implement the in-place editing functionality.

Expanded Online Videos

Expanded Assigning Editors Explicitly

To specify an in-place editor for a column, create a specific repository item, add it to the grid's internal or external repository, and then assign it to a column from the GridColumn.ColumnEdit property.

At design time, you can use one of two ways to assign an in-place editor to a column without invoking the Grid Designer.

  • Using a Smart Tag

    When you select a column header, it displays a smart tag that, when clicked, invokes a Tasks pane containing common column customization actions. Among them is a dropdown control allowing you to assign an in-place editor to the column.

    The dropdown control provides the Existing and New categories. In the Existing category, you can choose from a number of existing in-place editors (this category lists editors stored both in the grid's internal and external repositories). The New category allows you to create a new in-place editor. When you click an item within the New category, a corresponding repository item is created and added to the grid's internal repository.

  • Using the Properties Window

    When a column header is clicked, the column's settings are displayed in the Properties window. To assign an in-place editor to the column, use the ColumnEdit property, which provides a dropdown control (similar to the one in the image above), to select the in-place editor:

Expanded Example

The code below shows how to create a ComboBoxEdit editor for in-place editing within the columnCity column. A RepositoryItemComboBox object representing an in-place editor of the ComboBoxEdit type is created and added to the grid's internal repository:

The image below shows the View before and after the execution of the sample code.

Expanded Default Editors

If a column's GridColumn.ColumnEdit property value is null (Nothing in Visual Basic), the column uses a default editor. The default editor's type depends on the bound data field type. By default, columns bound to DateTime fields use date editors, columns bound to Boolean fields use check editors, and in all other cases, text editors are used. The actual repository item bound to a column can be obtained via the column's GridColumn.RealColumnEdit property.

Note that default editors are not added to the grid control's internal repository, and you cannot change their settings at runtime. These editors are created dynamically when requested, thus they always use their default behavior. This means that if you need to use a customized check box editor for a Boolean column, you should create the corresponding repository item and assign it explicitly to the desired column. This is true for all default editor types.

Expanded See Also

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