WPF Linq Results to datagrid
<p>I am trying to show my linq results using datagrid in WPF which doesnt have datasource like datagridview in winforms..</p>

<p>I've been struggling with this for hours now and just don't understand what it is I need to do. My code is as follows:</p>

<pre><code>private void BindDataGrid(string searchString) //passed on button click
    {
        DatabaseEntities entity = new DatabaseEntities();

            var postcodes = (from p in entity.postcode_table
                             where p.postcode.Equals(searchString)
                             orderby p.postcode ascending
                             select p);
            dataGrid.ItemsSource = postcodes;
    }
</code></pre>

<p>Any help here would be great. This isnt something I do on a day to day basis so please bear with me.</p>

<p>Thanks</p>