Access and Identify Columns

Identify Columns

The table below lists properties and XAML attributes that allow you to identify grid columns (or card fields in a Card View).




Uniquely identifies a column so that it can be accessed from code-behind or general code.

<dxg:GridColumn x:Name="colProduct" FieldName="ProductName"/>


Specifies the name of a data source field to which a column is bound. Note that the grid can display multiple columns bound to the same data field.


Returns the focused column.

Access Columns

If a column is created at design time, you can specify its unique name using the x:Name attribute. In this instance, a column can be accessed by its name from code-behind:

    <dxg:GridColumn x:Name="colProduct" FieldName="ProductName"/>
    <dxg:GridColumn x:Name="colUnitPrice" FieldName="UnitPrice"/>
colUnitPrice.AllowMoving = DevExpress.Utils.DefaultBoolean.False;

Since columns are contained within the grid's GridControl.Columns collection, individual columns can be accessed by field name or using indexed notation:

    <dxg:GridColumn FieldName="ProductName"/>
    <dxg:GridColumn FieldName="UnitPrice"/>
GridColumn colProduct = grid.Columns["ProductName"];
GridColumn colPrice = grid.Columns[1];

The focused column can be accessed using the DataControlBase.CurrentColumn property.