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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:54:58+00:00 2026-06-06T06:54:58+00:00

I have already read some posts, but no one helped me with my problem.

  • 0

I have already read some posts, but no one helped me with my problem.
So, i have a View with a Viewmodel and inside the View a DataGrid boudn to a ObservableCollection inside the viewmodel.
The Selected Item is also Bound to Type T == ObservableCollection

public ObservableCollection<TableProperty> TableProperties
    {
        get
        {
            return tableProperties;
        }
        set
        {
            if (tableProperties != value)
            {
                tableProperties = value;
                OnPropertyChanged("TableProperties");
            }
        }
    }

public TableProperty Property
    {
        get
        {
            return property;
        }
        set
        {
            property = value;
            OnPropertyChanged("Property");
        }
    }

And here the DataGrid:

<toolkit:DataGrid AutoGenerateColumns="False" 
                      UseLayoutRounding="True" 
                      ItemsSource="{Binding Path=TableProperties,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,NotifyOnTargetUpdated=True}"
                      SelectedItem="{Binding Path=Property,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" 
                      [...]>
        <toolkit:DataGrid.Columns>

Now i want to implement a logic that changing a checkbox triggers a command setting some values of the selected item:

<toolkit:DataGridTemplateColumn Header="Mandatory" IsReadOnly="False">
                <toolkit:DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                            <CheckBox IsChecked="{Binding Path=Mandatory,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                                <CheckBox.Style>
                                    <Style TargetType="{x:Type CheckBox}">
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding Path=MandatoryDB}" Value="True">
                                                <Setter Property="IsEnabled" Value="False" />
                                            </DataTrigger>
                                            <DataTrigger Binding="{Binding Path=MandatoryDB}" Value="False">
                                                <Setter Property="IsEnabled" Value="True" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </CheckBox.Style>
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="Checked">
                                        <cmd:EventToCommand Command="{Binding Path=DataContext.SetMandatory, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </CheckBox>
                        </StackPanel>
                    </DataTemplate>
                </toolkit:DataGridTemplateColumn.CellTemplate>
            </toolkit:DataGridTemplateColumn>

And this is the Command behind it:

 private void OnSetMandatory()
    {
        property.Visible = true;
        property.ReadOnly = false;
        property.VisibleInGrid = true;
        property.UIPropertyName = DateTime.Now.TimeOfDay.ToString();
        OnPropertyChanged("Property");
        OnPropertyChanged("TableProperties");
    }

The Problem is: when I change the properties the item inside the collection has also been updated and it goes properly inside the Property Getter…
If I call Datagrid.Items.Refresh() inside the view directly it will also display the values correctly, but not automatically from updating the collection.

So do you have any idea? 🙂

  • 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-06T06:55:00+00:00Added an answer on June 6, 2026 at 6:55 am

    TableProperty class has to implement INotifyPropertyChanged and raise it properly.

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

Sidebar

Related Questions

I have already read all the previous similar posts but I couldn't find a
I have already read some info about his issue on the web, but I
I have read some threads regarding this and I did already take steps to
I have read several posts already. And almost everyone suggest using QuartzCore/QuartzCore.h with layer.cornerRadius
I just want what my title says.I have already read all the previous similar
Possible Duplicate: What’s with the love of dynamic Languages I have already read this
I want to read .ppt files from the iPhone mail app. I have already
We have a table already existing in oracle 11g database which allows read as
I have already googled and searched stackoverflow but I can find nothing related to
I have read through multiple posts here until my head was ready to explode

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.