
Use the CellData.Item property to access the whole data row object ( Employee) and bind its properties to properties of labels defined in the template.

In this example, a column cell displays not only this field value but also the values of two more fields. Its CellData.Value property provides access to a value of a data field assigned to the column’s GridColumn.FieldName property. The CellData object specifies a binding context for a cell template. Each cell contains a with three elements bound to the Name, Position and HireDate properties of the Employee class. This column displays names, positions and hire dates of employees.Īssign a template to the TemplateColumn.DisplayTemplate property to define the presentation of column cells. This column displays photos of employees ( images added to a project as embedded resources). Each Employee object contains an employee’s photo (image), name, position, phone, address (strings), hire and birth dates (DateTime values), employee’s access level (enumeration value), and a Boolean value indicating whether an employee is on vacation.Īdd the following columns to the DataGridView.Columns collection: The grid is bound to a collection of Employee objects.

Please refer to the Website Terms of Use for more information in this regard.This example shows how to create columns in DataGridView to display and edit data of different types. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the Website Terms of Use for more information in this regard.Ĭonfindential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Disclaimer: The information provided on and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind.
