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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:39:13+00:00 2026-06-05T21:39:13+00:00

I bind a list<> to a datagrid. Then, in the code behind, I change

  • 0

I bind a list<> to a datagrid. Then, in the code behind, I change the value in the list<>. How can I display the change in the datagrid?

Xaml code:

<DataGrid Name="gridTest" Grid.RowSpan="1" CanUserAddRows="False">
        <DataGrid.Columns>
            <DataGridTemplateColumn Header="Enable" Width="SizeToHeader" IsReadOnly="False">
                <DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <CheckBox  IsChecked="{Binding  Path=isEnable, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
                    </DataTemplate>
                </DataGridTemplateColumn.CellTemplate>
            </DataGridTemplateColumn>
            <DataGridTextColumn Binding="{Binding  Path=test_name, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Header="test_name" Width="SizeToHeader"  IsReadOnly="True"/>
            <DataGridTextColumn Binding="{Binding  Path=test_type, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Header="test_type" Width="SizeToHeader" IsReadOnly="True"/>
            <DataGridTextColumn Binding="{Binding  Path=test_temp_index, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Header="test_temp_index" Width="SizeToHeader" IsReadOnly="True"/>
            <DataGridTextColumn Binding="{Binding  Path=lower_limit, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Header="lower_limit" Width="SizeToHeader" IsReadOnly="True"/>
            <DataGridTextColumn Binding="{Binding  Path=upper_limit, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Header="upper_limit" Width="SizeToHeader" IsReadOnly="True"/>
            <DataGridTextColumn Binding="{Binding  Path=board_test_point_description, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Header="board_test_point_description" Width="SizeToHeader" IsReadOnly="True"/>
            <DataGridTextColumn Binding="{Binding  Path=test_point_sequence, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Header="test_point_sequence" Width="SizeToHeader" IsReadOnly="True"/>
            <DataGridTextColumn Binding="{Binding  Path=fixture_test_point, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Header="fixture_test_point" Width="SizeToHeader" IsReadOnly="True"/>
        </DataGrid.Columns>
    </DataGrid>

Code Behind:

list:

public class fct_board_testpoint
{
    #region define Property
    public int profile_id { get; set; }
    public int test_point_sequence { get; set; }
    public int fixture_test_point { get; set; }
    public string test_type { get; set; }
    public float upper_limit { get; set; }
    public float lower_limit { get; set; }
    public string test_name { get; set; }
    public string board_test_point_description { get; set; }
    public int test_temp_index { get; set; }

    public bool isEnable { get; set; } //not in profile only for testing
    #endregion

}

Binding:

this.gridTest.ItemsSource = UIBase.listTestPoint;

Change binding source value:

foreach (fct_board_testpoint tp in UIBase.listTestPoint)
        {
            tp.board_test_point_description = "Success";
            tp.isEnable = true;
        }
  • 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-05T21:39:15+00:00Added an answer on June 5, 2026 at 9:39 pm

    The class fct_board_testpoint has to implement INotifyPropertyChanged, this interface holds an event that you raise each time a property has changed.

    class fct_board_testpoint : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
    
        bool isEnabled;
    
        public bool IsEnabled
        {
            get { return isEnabled; }
            set
            {
                isEnabled = value;
                PropertyChangedEventHandler temp = PropertyChanged;
                if (temp != null)
                    temp(this, new PropertyChangedEventArgs("IsEnabled"));
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to bind a list of data to a data grid, but can't
I've got a simple WPFToolkit DataGrid : <Grid> <dg:DataGrid Name=theDataGrid/> </Grid> And in code
i want to bind list to a datagrid dynamically, following code works for first
I've an ASP.Net 2.0 Gridview control that I can bind a List<T> too, for
I'm trying to bind a XAML ComboBox so that its list items are the
Basically I'm using the ItemSource property of the datagrid to bind a generic list
I've List and i bind these list to datagrid that is working fine, but
Background I'm trying to bind my objects to a DataGrid I have a list
I have a following XAML: <DataGrid Name=nodeDataGrid ItemsSource={Binding NodeList} AutoGenerateColumns=False RowBackground=White AlternatingRowBackground=AliceBlue Grid.Column=1 HorizontalAlignment=Stretch
I am trying to bind a DataGrid to a generic list in WPF. The

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.