DataGrid绑定结构
Header
1: System.Web.UI.WebControls.TableCell
Controls Count: 3
System.Web.UI.LiteralControl
System.Web.UI.WebControls.TextBox
System.Web.UI.LiteralControl
2: System.Web.UI.WebControls.TableCell
Controls Count: 0
3: System.Web.UI.WebControls.TableCell
Controls Count: 0
Item
1: System.Web.UI.WebControls.TableCell
Controls Count: 3
System.Web.UI.LiteralControl
System.Web.UI.WebControls.CheckBox
System.Web.UI.LiteralControl
2: System.Web.UI.WebControls.TableCell
Controls Count: 0
3: System.Web.UI.WebControls.TableCell
Controls Count: 0
Footer
1: System.Web.UI.WebControls.TableCell
Controls Count: 0
2: System.Web.UI.WebControls.TableCell
Controls Count: 0
3: System.Web.UI.WebControls.TableCell
Controls Count: 0
-------------------
ID | Name | |
1 | first |
-----------
{
Response.Write(e.Item.ItemType.ToString());
Response.Write("<br>");
if(true)//e.Item.ItemType == ListItemType.Header)
{
int i=1;
foreach( TableCell c in e.Item.Cells)
{
Response.Write( i.ToString() + ": ");
i++;
Response.Write( c.ToString() + "<br>");
int count = c.Controls.Count ;
Response.Write(" Controls Count: " + count.ToString() + "<br>");
if(count>0)
{
foreach(Control ic in c.Controls)
{
Response.Write(" ");
Response.Write(ic.ToString());
Response.Write("<br>");
}
}
}
}
}