DataGrid TextColumn

A DataGridTextColumn converts the content of each associated cell to a System.String object.

A DataGridTextColumn performs better than a DataGridTemplateColumn.

Important Properties

Here are the specific properties for the Text Columns:

  • PropertyName—Specifies the name of the property of the object type that represents each row within the grid.
  • HeaderText—Defines the content that will be displayed in the Header UI that represents the column.
  • CellContentFormat—Defines the custom format for each cell value. The String.Format routine is used and the format passed has to be in the form required by this method.
  • CellContentStyle—Defines the Style object that sets the appearance of each cell associated with this column.
  • CellContentStyleSelector—Defines the StyleSelector instance that allows for the dynamic appearance on a per-cell basis.
  • CellContentTemplate (DataTemplate)—Defines the appearance of each cell associated with the concrete column. CellContenTemplate enables you to wrap the text inside each DataGrid column. You can add a Label as a content of the Text and Template Column and wrap its text by using the LineBreakMode Label property.
  • CellEditTemplate (DataTemplate)—Defines the editor associated with the concrete column. The CellEditTemplate is displayed when the cell is in edit mode.

For more information about CellDecorationStyle and CellDecorationStyleSelector, refer to the Columns Styling topic.

CellContentFormat uses the format string provided by the framework. For more details, refer to the String.Format article.

Example

Here is an example how the Text Column properties can be used:

<telerikGrid:DataGridTextColumn PropertyName="Name"
                                HeaderText="Name"
                                CellContentFormat="FC {0}">
    <telerikGrid:DataGridTextColumn.CellContentStyle>
        <telerikGrid:DataGridTextCellStyle TextColor="Green"
                                           FontSize="15"
                                           SelectedTextColor="Orange"  />
    </telerikGrid:DataGridTextColumn.CellContentStyle>
 </telerikGrid:DataGridTextColumn>

Text Column

See Also

In this article
Not finding the help you need?