0
我想綁定一個asp.net gridview到linq查詢結果。它的工作原理,但我無法得到結果集中的列數。以下是pageLoad事件中的代碼。ASP.NET Gridview綁定到LINQ數據集ColumnCount
Dim resultSet = (From item In db.wthistory Select item).ToList
GridView1.DataSource =resultSet
GridView1.DataBind()
Response.Write(GridView1.Rows.Count) ' this works and prints the correct number of rows
Response.Write(GridView1.Columns.Count) 'this always prints 0 !
Gridview綁定正確,並顯示正確的數據,但爲什麼是columncount 0?