title: Unable to bind inherited class to an datagrid wpf c#
body: <pre><code>//In Test.xaml 
  
   &lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="30"&gt;&lt;/RowDefinition&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;DataGrid  Grid.Row="0"  AutoGenerateColumns="False" ItemsSource="{Binding}"   Name="dtGridTran" HorizontalAlignment="Left"   CanUserAddRows="True"   &gt;
              &lt;DataGrid.Columns&gt;
                  &lt;DataGridTextColumn Header="X" Binding="{Binding Path=X, UpdateSourceTrigger=PropertyChanged}"   Width="200"/&gt;               
                  &lt;DataGridTextColumn Header="Y" Binding="{Binding Path=Y, UpdateSourceTrigger=PropertyChanged}" Width="200"  /&gt;
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
          &lt;Label Grid.Row="1" Content=" Total Sum of x and Y"&gt;
  
          &lt;/Label&gt;
          &lt;TextBox  Grid.Row="1" Text="{Binding Path=Total, UpdateSourceTrigger=PropertyChanged}" Margin="150,0,0,0" Width="100"&gt;&lt;/TextBox&gt;       
      &lt;/Grid&gt;
  
  //In Test.xaml.cs file
  public partial class Test : Page
      {
  
          Derivedclass D = new Derivedclass();
          public Test()
          {
              InitializeComponent();
              this.DataContext = D;
              dtGridTran.ItemsSource = new TestGridItems();
          }
  
      }
  
  public class TestGridItems : List&lt;Derivedclass&gt;
  {
  }
  
  // In Base class
  public class Baseclass : INotifyPropertyChanged
      {
          public event PropertyChangedEventHandler PropertyChanged;
          private int mTotal = 0;
          private int mID = 0;
  
          public int Total
          {
              get { return mTotal; }
              set
              {
                  mTotal = value; OnPropertyChanged("Total");
              }
          }
          public int ID
          {
              get { return mID; }
              set { mID = value; }
          }
          public string Item = "xxx";
          // Create the OnPropertyChanged method to raise the event 
          protected void OnPropertyChanged(string PropertyName)
          {
              PropertyChangedEventHandler handler = PropertyChanged;
              if (handler != null)
              {
                  handler(this, new PropertyChangedEventArgs(PropertyName));
              }
          }
  
      }
  
  In Derivedclass.cs
  
      public class Derivedclass : Baseclass, INotifyPropertyChanged
      {
          public event PropertyChangedEventHandler PropertyChanged;
          private int mX = 0;
          private int mY = 0;
          public int X
          {
              get { return mX; }
              set
              {
                  mX = value;
                  base.Total = base.Total + mX;
                                  OnPropertyChanged("Total");
  
              }
          }
          public int Y
          {
              get { return mY; }
              set
              {
                  mY = value;
                  base.Total = base.Total + mY;
                  OnPropertyChanged("Total");
              }
          }
           // Create the OnPropertyChanged method to raise the event 
          protected void OnPropertyChanged(string PropertyName)
          {
              PropertyChangedEventHandler handler = PropertyChanged;
              if (handler != null)
              {
                  handler(this, new PropertyChangedEventArgs(PropertyName));
              }
          }
      }
  }
  </code></pre>
  
  <p>Here am trying to find total sum of x and y value. but m getting total sum zero . total property is in base class. i want total sum of x and y column that i want to display in a textbox.. but Total property of baseclass return zero while adding multiple value.</p>