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 6909205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:39:36+00:00 2026-05-27T08:39:36+00:00

I have seen similar posts like this However, they don’t seem to answer my

  • 0

I have seen similar posts like this

However, they don’t seem to answer my question. I have a XAML datagrid in a WPF application

<DataGrid AutoGenerateColumns="True" Grid.Row="1" AlternationCount="2" HeadersVisibility="Column" Name="dgSkillsMatrix" Margin="0,0,0,1" HorizontalGridLinesBrush="White" VerticalGridLinesBrush="White" AlternatingRowBackground="#FFD0D0EB" RowBackground="#FFECECF5" FontSize="12">
    <DataGrid.CellStyle>
        <Style TargetType="{x:Type DataGridCell}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Value}" Value="1">
                    <Setter Property="Background" Value="Red"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Content}" Value="2">
                    <Setter Property="Background" Value="Green"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Text}" Value="1">
                    <Setter Property="Background" Value="Black"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Name}" Value="Temp">
                    <Setter Property="Background" Value="Black"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </DataGrid.CellStyle>
</DataGrid>

As you can see, I have tried a number of different ways to “Trigger” the colour change, but none of them fire. If I put a generic setting in abouve the triggers it will change the colour.

I think the problem is that I am binding to the datagrid from a dynamic set of data that could change day to day, so I am using a datatable (below), as there is a varying number of coulmns that mean I can’t use objects for each row, as I never know when the number of columns/properties would change.

this.dgSkillsMatrix.ItemsSource = (dt as IListSource).GetList();

I just need to know how to fire a trigger to change properties depending on that value of a cell created from a datatable to listsource.

  • 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. Editorial Team
    Editorial Team
    2026-05-27T08:39:37+00:00Added an answer on May 27, 2026 at 8:39 am

    Does this link offer any assistance? It appears that binding to a DataTable may cause a few issues for cell colouring, have you tried implementing a data converter and MultiDataBinding as the article suggests?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've seen some similar posts, but nothing quite like this... I have a website
I have seen several posts similar to this but none with a strait forward
(Please note that I have seen a similar question on StackOverflow recently, however I
I have seen several other posts with similar questions but nothing exactly like what
i have seen similar posts here but i have had no luck solving my
I've seen similar posts on this on the umbraco forum, but none that I
I've seen some posts on here regarding similar ideas to this, but to be
I have seen a number of posts similar but wasn't able to achieve my
So I have seen some other posts similar, but not quite answering what I
I've seen a few similar posts to my problem, but none that have helped

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.