zoukankan      html  css  js  c++  java
  • 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


    -----------

    private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
            
    {
                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(
    " &nbsp;&nbsp;&nbsp;&nbsp;Controls Count:&nbsp;  " + count.ToString() + "<br>");
                        
    if(count>0)
                        
    {
                            
    foreach(Control ic in c.Controls)
                            
    {
                                Response.Write(
    "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                                Response.Write(ic.ToString());
                                Response.Write(
    "<br>");
                            }

                        }

                    }

                    
                }

            }
  • 相关阅读:
    MSSQL Rebuild(重建)索引
    网络爬虫原理
    Twitter Storm:单机环境的安装与配置
    1079 回家
    Win2003 Server磁盘配额揭密之补遗篇
    Win2003 Server磁盘配额揭密之启用篇
    编译mapnik(win7 环境下vs2008编译mapnik 0.7.1 成功)
    Writing a Windows Shell Extension(marco cantu的博客)
    Android学习之一:Cygwin简介
    Linux 进程间通信(一)
  • 原文地址:https://www.cnblogs.com/yizhinantian/p/551750.html
Copyright © 2011-2022 走看看