DataGrid binding

May 26, 2009 at 8:52 PM

Hi guys,

Tanks for the valuable help that you all provide.

My problem is that i'm trying to bind some child obj to a datagrid with no sucess.

I have the obj's like this:


public class PC: INotifyPropertyChanged


        private string m_ano;

        public string Ano
            get { return m_ano; }
            set { m_ano = value;

        public List<Component> GetComponent()
            return LComponent;

end of class

public class Component: INotifyPropertyChanged


I also have a window

 public Window()
            //*INI* Binding

          BL.Source = ALFactory.GetPC();  // Returns a generic list of Components

           this.DataContext = BL.View;

            BLL.Source = ALFactory.LAL[BL.View.CurrentPosition].GeComponent() ;//Returns a list of components
            this.dgComponents.DataContext = BLL.View;

            //*END* Binding



 <my:DataGrid AutoGenerateColumns="False"  
                     Margin="12,163,12,81" Name="dgComponents" ItemsSource = "{Binding}"

Path for all datagridTextColumns

The beaver that i have is that the datagrid don't get the obj Compents into when i add one to the obj list (child of the PC obj)

The binding only apear to get set for the textbox's int he window not with the datagrid allways is empty

Many tanks for any help