Note that there are some explanatory texts on larger screens.

plurals
  1. POLINQ: Concating two lists and creating a new one doesnt seem to be bindable
    text
    copied!<p>I'm trying to concat two lists and get a new anonymous one, then binding the one to a grid in silverlight for an app:</p> <pre><code> var lst = from games in AppLogic.CurrentApp.GAMES.Entities from playedGames in AppLogic.CurrentApp.PLAYEDGAMES.Entities.Where(f =&gt; f.GameID == games.ID).DefaultIfEmpty() select new { ID = games.ID, Date = games.Date, MaxPoints = games.MaxPoints }; dgGames.ItemsSource = lst; </code></pre> <p>But I always get a nullreferenceexception. I've seen this syntax in another stackoverflow thread (sadly I didnt marked the url), but it doesnt seem to work this way. Am I doing something fundamentally wrong or can't I just bind the new list like this? </p> <p>The binding is like this:</p> <pre><code> &lt;Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"&gt; &lt;data:DataGrid x:Name="dgGames"&gt; &lt;data:DataGrid.Columns&gt; &lt;data:DataGridTextColumn Visibility="Collapsed" Binding="{Binding ID}" /&gt; &lt;data:DataGridTextColumn Header="Datum" Binding="{Binding Date}" /&gt; &lt;data:DataGridTextColumn Header="Punkte" Binding="{Binding MaxPoints}" /&gt; &lt;!--&lt;data:DataGridTextColumn Header="Gewinner" Binding="{Binding Winner}" /&gt;--&gt; &lt;/data:DataGrid.Columns&gt; &lt;/data:DataGrid&gt; &lt;/Grid&gt; </code></pre> <p>P.S.: As you can see I'm not even taking data from the left joined "PlayedGames", but it doesnt seem to work still.</p> <p>Sorry in advance if there is something stupid wrong. I tinkered the code from some examples I found, so I cant be sure if they are even working.</p> <p>Thanks alot for all answers!</p> <p>Matthias</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload