WPF ItemsSource Binding -


text "itemprop =" text ">

I have a data grid control in my WPF application and I have an ObservableCollection property in the orbit of my main window that constrain the control I'm trying to The assets I am trying to bind are defined as:

  Private Observable Collination & lt; RequestResult & gt; M_SentRequests = new reviewable selection & lt; Request area & gt; (); Public supervision qualification & lt; Request area & gt; SentRequests {get {return m_SentRequests; }}   

My datagrid is in a group by which DataContext is set to MainWindow:

   & Lt; / Grid & gt; & Lt; / GroupBox & gt;   

After selecting SentRequests as my item resources, I still can not select the "Edit property-bound columns" option, I think that in the property window The problem is happening. Let me get a single error when I select "Get the dialog before" before you execute this action "Get the dialog" and "Generate columns" and select "Remove columns" as if I have for my dialog ItemsSource has nothing set in the property, it is.

Although I can set AutoGenerateColumns to the actual and I am looking to force my data to be (though, with no column I want to show).

I am very new to WPF and I am writing it as a quick test app for testing the windows service.

Anyone know what I'm doing wrong here?

I do not think you need the path parameter within your item. You should just be able to install the bond as itemsSource = {Binding SentRequests}

You can also force if I create a dummy archive to source grid items in the code for example :

  public class people {get public string first name {; Set; } Public String LastName {get; Set; } Public string age {receive; Set; } Public string address {get; Set; } Public string zip {get; Set; }}   

and then populate it

  this.AllPeople = new ObservableCollection & lt; People & gt; (); Private Zero FillData () {People P1 = New People (); P1.FirstName = "John"; P1.LlastName = "DO"; P1.Age = "24"; P1.address = "123 Main Street"; P1.zip = "11111"; People P = 2 new people (); P2.FirstName = "Jane"; P2.LlastName = "Smith"; P2.Age = "36"; P2.address = "456 Water Street"; P2.zip = "22222"; People P3 = new people (); P3.FirstName = "Larry"; P3.LlastName = "Williams"; P3.Age = "24"; P3.address = "785 Water Street"; P3.zip = "33333"; This.AllPeople.Add (p1); This.AllPeople.Add (P2); This.AllPeople.Add (P3); }   

Then I can set the item source in the main page constructor or method:

this.gridviewname.ItemsSource = "AllPeople";

Comments