title: Unhandled Error in Silverlight Application Code: 4004 System.Collections.Generic.KeyNotFoundException
body: <p>I'm getting this error in a very strange manner. I've been able to isolate it, and I know what is causing it, but I don't have a clue why.</p>
  
  <p>This is the situation: I have a ChildWindow, which contains a TabControl, which contains two UserControl, and both of them contain a datagrid like this causing the unhandled error:</p>
  
  <pre><code>&lt;sdk:DataGrid x:Name="PersonEmailDataContainer" AutoGenerateColumns="False" Height="119" HorizontalAlignment="Left" Margin="12,39,0,0" VerticalAlignment="Top" Width="736"
    ItemsSource="{Binding PagedListOfPersonEmail, Mode=TwoWay}" 
    ColumnHeaderStyle="{StaticResource ColBinding}" 
    SelectedItem="{Binding SelectedPersonEmail, Mode=TwoWay}" 
    IsReadOnly="{Binding PersonEmailDataContainerIsReadOnly, Mode=TwoWay}"&gt;
    &lt;sdk:DataGrid.Columns&gt;
        &lt;sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True"
           CanUserSort="True" Width="Auto" /&gt;
        &lt;sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True" 
           CanUserSort="True" Width="20*"
           Binding="{Binding Email, Mode=TwoWay}" 
           Header="{Binding ConverterParameter=HdrEmail, Converter={StaticResource Localization}, Source={StaticResource Localization}}"  /&gt;
        &lt;sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True" 
           CanUserSort="True" Width="20*"
           Binding="{Binding WebSite, Mode=TwoWay}" 
           Header="{Binding ConverterParameter=HdrWebSite, Converter={StaticResource Localization}, Source={StaticResource Localization}}"  /&gt;
    &lt;/sdk:DataGrid.Columns&gt;
          &lt;!-- more columns --&gt;
      &lt;/sdk:DataGrid&gt;
  </code></pre>
  
  <p>I solved it by removing the first column, which is just a blank column. It displays no data, it has no bindings, it doesn't even have a header to display. Any ideas why this was causing the error?</p>