title: ASP only shows the first gridview when var type is used
body: <p>I'm just a poor beginner on ASP and C#. When running below two GridViews, just get in the <code>default.aspx</code> page the Gridview1. Tried also defining DataSourceId in aspx code but without success. Looks like ASP only shows the first gridview found in the code ignoring the second one. Really appreciate your help!</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Text;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using CsvHelper.TypeConversion;
  using CsvHelper;
  using System.IO;
  sing CsvHelper.Configuration;
  using System.Data;
  using System.Windows;
  
  public partial class _Default : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          StreamReader sr = new StreamReader(Server.MapPath(@"MAD-DC01.MAD-TEST.ES.201808.csv"));
          CsvReader csvread = new CsvReader(sr);
  
          IEnumerable&lt;TestRecord&gt; record = csvread.GetRecords&lt;TestRecord&gt;();
          var Prints = from t in record     
                       group t by new { t.Airline, t.Kiosk_name,t.Type_print } into grupo
                       orderby grupo.Key.Airline ascending
                       select new
                              {
                                   Aerolinea = grupo.Key.Airline,
                                   Kiosko = grupo.Key.Kiosk_name,
                                   Impresion=grupo.Key.Type_print,
                                   cuenta = grupo.Sum(x =&gt; x.Prints_outs),
                              };
      var Total_Prints = from t2 in record
                         group t2 by new { t2.Airline,t2.Type_print } into grupo2
                         orderby grupo2.Key.Airline ascending
                         select new
                                {
                                    Aerolinea = grupo2.Key.Airline,
                                    Impresion = grupo2.Key.Type_print,
                                    cuenta = grupo2.Sum(x =&gt; x.Prints_outs),
                                }; 
  
      GridView1.DataSource = Prints.ToList();
      GridView1.DataBind();
  
      GridView2.DataSource = Total_Prints.ToList();
      GridView2.DataBind();
  }
  
  public class TestRecord // Test record class
  {
      public DateTime Date { get; set; }
      public string Airport { get; set; }
      public string Type_print { get; set; }
      public string Airline { get; set; }
      public string Kiosk_name { get; set; }
      public Int32 Prints_outs { get; set; }
  
  }
  </code></pre>
  
  <p>This is the aspx part:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form runat="server"&gt;
   &lt;div&gt;
  
       &lt;asp:GridView ID="GridView1" runat="server" OnSelectedIndexChanged="GridView1_SelectedIndexChanged1"&gt;
       &lt;/asp:GridView&gt;
       &lt;asp:GridView ID="GridView2" runat="server" OnSelectedIndexChanged="GridView2_SelectedIndexChanged"&gt;
       &lt;/asp:GridView&gt;
       &lt;br /&gt;
  
   &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>