Edit this page

Data Column

GridViewDataColumn derives from GridViewBoundColumnBase, which means that it inherits all of the functionality too. In addition it allows you to easily bind data, format it and edit it using editors.

RadGridView's auto generated columns are of this type.

[XAML] Example 1: Define GridViewDataColumn in XAML.

<telerik:RadGridView x:Name="radGridView"
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}" />

[C#] Example 2: Define GridViewDataColumn in code

GridViewDataColumn column = new GridViewDataColumn();
column.DataMemberBinding = new Binding("Id");

[VB.NET] Example 2: Define GridViewDataColumn in code

Dim column As New GridViewDataColumn()
column.DataMemberBinding = new Binding("Id")

For performance reasons, you should work with UniqueName of GridViewBoundColumnBase only when you have also configured DataMemberBinding for it. Otherwise, please define GridViewColumn and use Header property instead.

Via the DataFormatString property you are able to format the bound data and display it the way you want. Figure 1 shows a DateTime column with a custom formatting:

Figure 1: GridViewDataColumn with custom formatting

GridViewDataColumn with custom formatting

To learn more about formatting please check Data Formatting topic.

See also