dotnet / dotnet/wpf

DynamicResource is not working for Header property in DataGridTextColumn

Open
#6,302 8 comments 2 reactions 1 assignee Claimed by @anjaligupta-dev View on GitHub
:construction: work in progress
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: .Net 6.0
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes

**Problem description:**

I have defined the DynamicResource for Header property in DataGridTextColumn of DataGrid. Please refer the below code snippet,
```XML

Before Change Name
After Change Name

```

```XML

```

When change the resource at runtime Header property does not change the value in DataGrid. Can you please check and elaborate why DynamicResource is not working in DataGridTextColumn.Header property of DataGrid?

**Note :**
If we use HeaderTemplate property in DataGridTextColumn its working properly in DataGrid. Please refer the code snippet,

```XML
















```
Please refer the Screenshot for your reference
Resource

**Minimal repro:**
Step 1: Run the sample

Step 2: Click the Change resource button

**Actual behavior:**
DynamicResource is not working for Header property in DataGridTextColumn

**Expected behavior:**
DynamicResource is working properly for Header property in DataGridTextColumn

I have attached the sample for your reference.
**Sample Link:** [DataGrid.zip](https://github.com/dotnet/wpf/files/8333012/DataGrid.zip)

Can you please check and provide the solution to use the DynamicResource in Header property in DataGridTextColumn?

Regards,
Vijayarasan S

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.