title: How can I read LINQ group by Query?
body: <p>this is my escenary, I Have a class called Plantilla that contains severals propertyes that allows bind a gridview in wpf, so that was working already, but users tells me that they need re-group the query by some field in database, so I prepare this snippet : </p>
  
  <pre><code>  var dsTemplates = (from t in db.PLANTILLAs
                                     join q in db.EQUIPOs on t.codigoequipo equals q.codigoequipo
                                     where t.codigoestudio.Substring(5, 1).Equals(codigoModalidad)
                                     orderby t.tituloplantilla
                                     group new Plantilla
                                     {
                                         codigoplantilla = t.codigoplantilla,
                                         codigoequipo = t.codigoequipo,
                                         nombreequipo = q.nombreequipo,
                                         codigoestudio = t.codigoequipo,
                                         conclusion = t.conclusion,
                                         hallazgo = t.hallazgo,
                                         nombreexamen = t.tituloplantilla,
                                         tecnica = t.tecnica
                                     } by t.codigoestudio
                  ).ToList();
                  formTemplates.dlstPlantillas.ItemsSource = dsTemplates;
                  db.Connection.Close();
  </code></pre>
  
  <p>Now my issue is how can I read the following? in Hashtable? how can I cast a generic to a Hashtable? cause I have now a List when T is my class Plantilla</p>
  
  <p>I binded it to a gridview so when I want to get the values from grid Im getting exception </p>
  
  <p>debug shows me this is my new type of Collection in gridview.SelectedItems[0];</p>
  
  <pre><code>[0] = {System.Data.Linq.SqlClient.ObjectReaderCompiler.Group&lt;string,Demo.View.Plantilla&gt;}
  </code></pre>