![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Why am I am getting an extra line in GridView with the following text in the 1st column: "System.Web.UI.WebControls.TableRow" Here's partial listing of my code: .................. grid.DataSource = loadTable(ds); grid.DataBind(); ................. private DataTable loadTable(DataSet ds) { DataTable dt = new DataTable(); DataTable myDataTable = ds.Tables[1]; int cols = myDataTable.Columns.Count; TableHeaderRow thr = new TableHeaderRow(); for(int i = 0; i < cols; i++) { TableHeaderCell thc = new TableHeaderCell(); thc.Text = myDataTable.Columns[i].ColumnName; thr.Cells.Add(thc); DataColumn dcol = new DataColumn(thc.Text, typeof(System.String)); dt.Columns.Add(dcol); } dt.Rows.Add(thr); return dt; } |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |