The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataGridTemplateColumn.CellEditingTemplate Property

Gets or sets the template that is used to display the contents of a cell that is in editing mode.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)

public DataTemplate CellEditingTemplate { get; set; }
<sdk:DataGridTemplateColumn CellEditingTemplate="templateReference"/>

XAML Values


A DataTemplate object element that defines the display for the editing mode. For more information, see DataGrid Styles and Templates.


A StaticResource reference to an existing DataTemplate definition.

Both attribute and property element syntax for RowDetailsTemplate are shown because defining the template inline as opposed to referencing an existing one as a resource are both equally valid scenarios.

Property Value

Type: System.Windows.DataTemplate
The template that is used to display the contents of a cell that is in editing mode. The default is null.

The following code example demonstrates how to set the CellEditingTemplate property in XAML. This example is part of a larger example available in the DataGrid class overview.

<sdk:DataGrid x:Name="dataGrid5" 
    Height="125" Margin="0,5,0,10"
        <!-- Name Column -->
        <sdk:DataGridTemplateColumn Header="Name">
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                        <TextBlock Padding="5,0,5,0"
                            Text="{Binding FirstName}"/>
                        <TextBlock Text="{Binding LastName}"/>
                    <StackPanel Orientation="Horizontal">
                        <TextBox Text="{Binding FirstName}" BorderThickness="0"/>
                        <TextBox Text="{Binding LastName}" BorderThickness="0"/>
        <!-- Address Column -->
            Header="Address" Width="300"
            Binding="{Binding Address}" />


Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft