Jennifer84 0 Posting Pro

Hello

I have a INotifyPropertyChanged function with rdNum declared as seen.

Now, I need to programatically add rdNum2 to the INotifyPropertyChanged function in the rdInsert_Click event.

How is this possible to do?

public class Window1 : INotifyPropertyChanged 
        { 
            private string _rdNum;  
            public string rdNum  
            {  
                get  
                {  
                    return _rdNum;  
                }  
                set  
                {  
                    _rdNum = value;  
                    NotifyPropertyChanged("rdNum");  
                }  
            } 
        } 
 
 
 
 private void rdInsert_Click(object sender, RoutedEventArgs e) 
 { 
        //How to programatically put rdNum2 to Window1 ? 
 
                                  DataGridTextColumn newcolumn = new DataGridTextColumn(); 
                            newcolumn.CellStyle = (Style)this.Resources["CellStyle"]; 
                            newcolumn.Width = DataGridLength.Auto; 
                            newcolumn.Foreground = new SolidColorBrush(Colors.Gray); 
                            newcolumn.IsReadOnly = true; 
                            newcolumn.Header = "NewColumn"; 
                            newcolumn.Binding = new Binding("rdNum2"); 
 
 
  }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.