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

  • Home
  • SEARCH
  • 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 9019255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:43:59+00:00 2026-06-16T04:43:59+00:00

I have successfully bound a column in a DataGrid to an observable collection with

  • 0

I have successfully bound a column in a DataGrid to an observable collection with objects implementing the INotifyPropertyChanged interface:

This is the xaml:

<dxg:GridColumn Name="Name" FieldName="Stapel" DisplayMemberBinding="{Binding Path=Name}" />

And the property in the objects class:

public string Name
    {
        get { return _name; }
        set
        {
            if (value == _name) return;
            _name = value;
            OnPropertyChanged("Name");
        }
    }

But in another column I am using a Template:

<dxg:GridColumn.CellTemplate>
    <DataTemplate>
        <StackPanel>
                <Rectangle Height="19" Width="19" Fill="{Binding Path=Data.StatusColor}"></Rectangle>
        </StackPanel>
    </DataTemplate>
</dxg:GridColumn.CellTemplate>

The Fill property of the rectangle is bound to a “calculated” property:

public SolidColorBrush StatusColor
{
    get
    {
        if (StapelStatus == StapelStatus.Neu)
        {
            return new SolidColorBrush(Colors.CornflowerBlue);
        }
        return new SolidColorBrush(Colors.DarkOrange);
    }
}

Some other property setters, which change the value of StapelStatus are calling

OnPropertyChanged("StatusColor"); 

I thought this would be enough to change also the color in the rectangle color in the grid column. But unfortunately when the StapelStatus is changed and OnPropertyChanged("StatusColor") is called the grid doesn’t reflect this change. I guess that I have to change somehow the binding in the DataTemplate. Can someone please give me an advice?

  • 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-06-16T04:44:01+00:00Added an answer on June 16, 2026 at 4:44 am

    It was indeed a binding problem in the XAML. Unfortunately I did not set the FieldName property in the GridColumn. I thought the FieldName is only for use in normal GridColumns which don’t have any Template.

    Below the working XAML for the column:

    <dxg:GridColumn Header="" FieldName="StatusColor">
        <dxg:GridColumn.CellTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                    <Rectangle RadiusX="19" RadiusY="19" Height="19" Width="19" Stroke="Black" Fill="{Binding Path=Value}"></Rectangle>
                    </StackPanel>
            </DataTemplate>
        </dxg:GridColumn.CellTemplate>
    </dxg:GridColumn>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a data entry interface and have successfully bound the columns that have
Here is the scenario: I have successfully bound two objects from a native ObjC
I have successfully bound a control to a property on my page. The property
i have successfully created distribution profiles and installed on my xcode organiser, but this
I have a TreeView that is bound to a collection class that I have
Using MVVM style I have successfully bound an ObservableCollection<string> to a ListBox , showing
I have successfully created and bound computed properties, but how can I get at
I'm trying to set up an NSCollectionView (I have done this successfully in the
I have the following code that successfully displays an image in its column based
I have successfully bound a circle to my marker using google map api v3.

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.