Edit this page

Basic Column

GridViewColumn is the base column type on top of which the other columns are built. It provides the common functionality typical for RadGridView's columns.

GridViewColumn inherits from FrameworkContentElement.

You can add aggregate functions to display their result in the column footers, manage the headers and cells, apply different styling for the its header and cells, reorder it, etc.

The most common usage of this type of column is when you want to define a column that doesn't bind to any data.

Such a column is frequently referred as “unbound” column.

A typical usage of such column involves setting the CellStyle/CellTemplate properties in order to place custom content within the cells such as buttons, checkboxes or even composite user controls rather than displaying data from the items source. You can check the Setting CellTemplate and CellEditTemplate article for more information on how to define your own CellTemplate or CellEditTemplate.

Here is a list of the most important properties and how they can be used.

  • AggregateFunctions - this property allows defining aggregate functions, which results will appear in the column footer. Read more here.

  • CellEditTemplate, CellStyle, CellTemplate - by setting these properties you are able to modify the default look of the cells in the columns e.g. to place custom elements in the cell. Read more here.

  • Footer, FooterCellStyle, GroupFooterStyle - by setting these properties you are able to modify the content and the appearance of the column footers. To learn how read the Column Footers topic.

  • Header, HeaderCellStyle - by setting these properties you can modify the content and the appearance of the column headers. More about the headers can be found in the Column Headers topic.

  • ToolTipTemplate - set to a DataTemplate to be shown when the mouse is over the column. Read more at Add ToolTip for columns and headers topic.

  • ToolTipTemplateSelector - gets or sets the data template selector for the cell tooltip.

  • IsFrozen - indicates whether the column is frozen or not. To learn more read the Frozen Columns topic.

  • IsGroupable - indicates whether the data in the RadGridView can be grouped by this column. More about grouping is to be found here.

  • IsReadOnly - indicates whether the cells in the column can be edited. More about editing the data in the RadGridView can be found here.

  • IsReordable - indicates whether the column can change its place in relation to the other columns in the collection. To learn more read the Reordering Columns topic.

  • IsResizable - indicates whether the user is allowed to resize the column. To learn more read the Resizing Columns topic.

  • IsSortable - indicates whether the user is allowed to sort by this column. More about sorting the data in the RadGridView can be found here.

  • IsFilterable - indicates whether the column can be filtered or not and whether the filtering UI (e.g. the funnel) is displayed in the respective header. More about filtering can be found here.

  • ShowDistinctFilters - indicates whether the user will see the distinct values in the filtering dialog. To learn more read the Filtering topics.

  • ShowFieldFilters - indicates whether the user will see the field filters (for manual entering the filter text) in the filtering dialog. To learn more read the Filtering topics.

  • FilterMemberPath - Gets or sets the FilterMemberPath for this column. More about Filter Member Path can be found here.

  • FilterMemberType Gets or sets the filter member type of the column. Set this property when the type cannot be automatically discovered from the FilterMemberPath.

  • SortingState - provides information about how the data is sorted - ascending, descending or not sorted. More about sorting the data in the RadGridView can be found here.

  • GroupMemberPath - defines the name of the property the data in the column will be grouped by.

  • SortMemberPath- defines the name of the property the data in the column will be sorted by.

  • GroupHeaderFormatString - defines the format of the group header.

  • ShowColumnWhenGrouped - indicates whether the column should be visible when grid is grouped by this column.

  • TabStopMode - Gets or sets the tab stop mode which denotes if cell could gain focus via TAB key.

  • TextDecorations - Gets or sets the text decoration. Affects all the cells in the column. This is a dependency property.

  • TextTrimming - Gets or sets TextTrimming that will be used to trim the text in this column cells. This is a dependency property.

  • TextWrapping - Gets or sets TextWrapping that will be used to wrap the text in this column cells. This is a dependency property.

Here is how to define a column of this type.

[XAML] Example 1: Define GridViewColumn in XAML:

<telerik:RadGridView x:Name="radGridView"
                 AutoGenerateColumns="False">
    <telerik:RadGridView.Columns>
        <telerik:GridViewColumn />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

[C#] Example 2: Define GridViewColumn in code:

GridViewColumn column = new GridViewColumn();
this.radGridView.Columns.Add(column);

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

Dim column As New GridViewColumn()
Me.radGridView.Columns.Add(column)

The columns are to be found in the same namespace as RadGridView control.