title: Can WPF handle Guids from LINQ to SQL?
body: <p>I stumbled on a strange problem. In my WPF (.NET 4) window I have a simple combobox (DisplayMemberPath="Name" SelectedValuePath="Id"). When I load the window I set the combobox's ItemSource property to context.Currencies.ToList() using LINQ to SQL. The Currency table in SQL is simply <em>[Id] [uniqueidentifier] NOT NULL PRIMARY KEY, [Name] char NOT NULL</em>. In .NET this translates to <em>Id = System.Guid, Name = System.String</em>.</p>
  
  <p>The problem I'm having is that the call to combobox.ItemsSource = context.Currencies.ToList(); throws a FormatException (Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)).</p>
  
  <p><strong>What I can't understand is why is this error thrown?</strong> </p>
  
  <p>If I leave LINQ to SQL out of the picture, define a "test" class - public class Test { public Guid Id; public string Name; }, set the comobox.ItemsSource to a <code>List&lt;Test&gt;</code> which contains some entries, then everything works.</p>
  
  <p>If I do this:</p>
  
  <pre><code>combobox.ItemsSource = context.Currencies.Select(c =&gt; new { c.Id.ToString(), c.Name }).ToList()
  </code></pre>
  
  <p>then everything works.</p>
  
  <p>I tried setting the current thread's Culture and UICulture to "en-US" beforehand as well (just in case it's a culture problem, my default culture is "et-EE"), but that didn't help either.</p>
  
  <p>I looked at the generated LINQ to SQL classes from the designer, but couldn't find any properties to alter which might have helped with this error.</p>
  
  <p><strong>Am I missing something here or is this really a bug in the .NET framework?</strong>´</p>
  
  <p>PS! The Currency table contains valid entries (valid Guids).</p>