Gets or sets a DataTemplateSelector that determines the template to use to display cells in a column. This is a dependency property.
Namespace:
System.Windows.Controls
Assembly:
PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Visual Basic (Declaration)
Public Property CellTemplateSelector As DataTemplateSelector
Dim instance As GridViewColumn
Dim value As DataTemplateSelector
value = instance.CellTemplateSelector
instance.CellTemplateSelector = value
public DataTemplateSelector CellTemplateSelector { get; set; }
public:
property DataTemplateSelector^ CellTemplateSelector {
DataTemplateSelector^ get ();
void set (DataTemplateSelector^ value);
}
public function get CellTemplateSelector () : DataTemplateSelector
public function set CellTemplateSelector (value : DataTemplateSelector)
XAML Property Element Usage
<object>
<object.CellTemplateSelector>
<MyDataTemplateSelectorImplementation .../>
</object.CellTemplateSelector>
</object>
<object CellTemplateSelector="{ResourceExtension DataTemplateSelectorClassKey}"/>
Dependency Property Information
The following properties all bind to and display the content of a column cell, and are listed here in their order of precedence, from highest to lowest:
The following example shows how to set the CellTemplateSelector property.
<ListView ItemsSource="{Binding Source={StaticResource EmployeeData},
XPath=Employee}">
<ListView.View>
<GridView>
<GridViewColumn Header="First Name"
DisplayMemberBinding="{Binding XPath=FirstName}" />
<GridViewColumn Header="Last Name"
CellTemplate="{StaticResource LastNameCellTemplate}"/>
<GridViewColumn Header="Favorite City"
CellTemplateSelector="{DynamicResource
FavoriteCityTemplateSelector}"/>
</GridView>
</ListView.View>
</ListView>
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework
Supported in: 3.5, 3.0
Reference