Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   Reporting
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Views
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Collapse]Data Editing and Validation
     Data Editing Overview
     Edit Form
     New Item Row
    [Expand]Inplace Editors
    [Expand]Input Validation
    [Collapse]Editing in Code
      Deleting Rows
      Obtaining and Setting Cell Values
     Clipboard Operations
     Moving Nodes in TreeList
   [Expand]Grouping
   [Expand]Selection
   [Expand]Filtering and Searching
   [Expand]Sorting
   [Expand]Data Summaries
   [Expand]Data Scrolling
   [Expand]Focus and Navigation
   [Expand]Conditional Formatting
   [Expand]Drag-and-Drop
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Miscellaneous
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Scheduler (legacy)
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Obtaining and Setting Cell Values

The grid provides multiple methods that allow you to obtain and modify its cell values, regardless of whether end-users are allowed to edit data. The required cell is identified by specifying its owning row and column. The row is specified by its handle. The column can be specified by its name or field name. For detailed information on how to obtain row handles and identify columns, see Obtaining Row Handles and Accessing and Identifying Columns.

Expanded Obtaining Cell Values

Use the following methods to obtain cell values:

Method Description
GridControl.GetCellValue Returns the value of the specified cell.
GridControl.GetFocusedRowCellValue

Returns the value of the specified cell displayed within the focused row.

The focused row isn't displayed if the DataViewBase.NavigationStyle property is set to GridViewNavigationStyle.None.

GridControl.GetFocusedValue

Returns the focused cell's value.

The focused cell is displayed if the DataViewBase.NavigationStyle property is set to GridViewNavigationStyle.Cell. Otherwise, this method returns null.

TreeListView.GetNodeValue

Returns the value of the specified cell displayed within the specified node.

GridControl.GetFocusedRowCellDisplayText

Returns the focused cell's text.

GridControl.GetCellDisplayText

Returns the text displayed within the specified cell.

Expanded Setting Cell Values

Method Description
GridControl.SetCellValue Sets the value of the specified cell.
TreeListView.SetNodeValue Sets the value of the specified cell in the specified node.
GridControl.SetFocusedRowCellValue

Sets the value of the specified cell displayed within the focused row.

The focused row isn't displayed if the DataViewBase.NavigationStyle property is set to GridViewNavigationStyle.None.

Once the cell's value has been changed, the GridViewBase.CellValueChanged event is raised.

Expanded Examples

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