GridView.ColumnHeaderTemplateSelector Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the selector object that provides logic for selecting a template to use for each column header.
public:
property System::Windows::Controls::DataTemplateSelector ^ ColumnHeaderTemplateSelector { System::Windows::Controls::DataTemplateSelector ^ get(); void set(System::Windows::Controls::DataTemplateSelector ^ value); };
public System.Windows.Controls.DataTemplateSelector ColumnHeaderTemplateSelector { get; set; }
member this.ColumnHeaderTemplateSelector : System.Windows.Controls.DataTemplateSelector with get, set
Public Property ColumnHeaderTemplateSelector As DataTemplateSelector
Property Value
The DataTemplateSelector object that determines the data template to use for each column header. The default value is null
.
Remarks
If you do not set this property, the default logic is to use the ColumnHeaderTemplate property for all columns if it is defined.
If the ColumnHeaderTemplate property and the ColumnHeaderTemplateSelector property are both set, the ColumnHeaderTemplate property takes precedence.
This property represents one of several ways to lay out and style column headers. For more information, see GridView Column Header Styles and Templates Overview.
XAML Attribute Usage
<object DataTemplateSelector="{ResourceExtension DataTemplateSelectorClassKey}"/>
XAML Property Element Usage
<object>
<object.ColumnHeaderTemplateSelector>
<MyDataTemplateSelectorImplementation .../>
</object.ColumnHeaderTemplateSelector>
</object>
XAML Values
ResourceExtension
One of the following: StaticResource
, or DynamicResource
. See XAML Resources.
DataTemplateSelectorClassKey
The key that identifies the selector implementation being requested. The key refers to a derived class that implements a practical SelectTemplate override. For information about how to map your custom class, see XAML Namespaces and Namespace Mapping for WPF XAML. You can also programmatically add an instance of your DataTemplateSelector class as a resource to the application resource dictionary.
MyDataTemplateSelectorImplementation
A class derived from DataTemplateSelector that implements a practical SelectTemplate override. For information about how to map your custom class, see XAML Namespaces and Namespace Mapping for WPF XAML.
Dependency Property Information
Identifier field | ColumnHeaderTemplateSelectorProperty |
Metadata properties set to true |
None |
Applies to
See also
Зворотний зв’язок
https://aka.ms/ContentUserFeedback.
Очікується незабаром: протягом 2024 року ми будемо припиняти використання механізму реєстрації проблем у GitHub для зворотного зв’язку щодо вмісту й замінювати його новою системою зворотного зв’язку. Докладніше:Надіслати й переглянути відгук про