Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 111257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:21:21+00:00 2026-05-11T02:21:21+00:00

I need to bind the column Header text of a DataGrid to a Resource

  • 0

I need to bind the column Header text of a DataGrid to a Resource string in a XAML file. Does anybody know if this is possible ?

The column Header definition looks like this but I would like to replace the ‘MyHeaderText’ with text from a resource file:-

<data:DataGridTextColumn Header='MyHeaderText' Binding='{Binding SomeData}' IsReadOnly='True'/> 

The Resource string would be set up in the UserControl.Resources section.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:21:22+00:00Added an answer on May 11, 2026 at 2:21 am

    The header presentation area is limited. You can achieve this though by utilizing a string instead of a UIElement. Make sure you have the xmlns for the ‘System’ namespace in your xaml file like so:

    xmlns:sys='clr-namespace:System;assembly=mscorlib' 

    Then have the following defined in your UserControl’s Resources section:

    <sys:String x:Key='MyHeader'>My Header Text</sys:String> 

    Then you can do basically what Sorskoot said and you shouldn’t receive an error:

    <data:DataGridTextColumn Header='{StaticResource MyHeader}' Binding='{Binding SomeData}' IsReadOnly='True' /> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to figure out how to bind a WPF DataGrid's column header
I need to save an string inside a Datagrid Column which differs from the
I need to bind grid view with check box column, droupdown column and text
I need to bind width property of the GridView column that is created dynamically
I had binded DataGrid to my collection, and i need bind height of each
this is my xaml code. <sdk:DataGrid x:Name=dgMarks CanUserResizeColumns=False SelectionMode=Single AutoGenerateColumns=False VerticalAlignment=Top IsReadOnly=True Margin=13,44,0,0 RowDetailsVisibilityChanged=dgMarks_RowDetailsVisibilityChanged
I have question how i can bind datagrid column to collection? dataGrid1.Columns.Add(new DataGridTemplateColumn {
I need to bind some data to a DataGrid with variable number of columns.
I need to have a kind of a datepicker in my datagrid header for
I've a table that contains 3 columns. I need to bind an event that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.