Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Specify an Editor for a Column

The following example shows how to specify a HyperLinkEdit control as an editor for a column in the main View of XtraGrid.

First we create a corresponding repository item and add it to the internal collection of repository items specified by the EditorContainer.RepositoryItems property.

Then the repository item is assigned to the column via the GridColumn.ColumnEdit property.

The image below demonstrates a grid control to which this code is applied:

Specifying column editor Example

    RepositoryItemHyperLinkEdit repHyperLink = new RepositoryItemHyperLinkEdit();
    gridControl1.RepositoryItems.Add(repHyperLink);
    (gridControl1.MainView as GridView).Columns["EMAIL"].ColumnEdit = repHyperLink;
    //customize the editor
    repHyperLink.LinkColor = Color.Maroon
    repHyperLink.Caption = "Click to e-mail"