• 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>");
                            }

                        }

                    }

                    
                }

            }
  • 相关阅读:
    javascript 获取get参数方法(获取url参数方法)详解
    javascript标签页切换功能(极简代码)
    mb_substr()截取中文方法的详解 (加上‘utf-8’,字符串截取不到的问题详解)
    mysql 垂直分表技术的实战演练,有实战代码。
    php+ajax 实战 (使用ajax小技巧)
    最近开发的ECG项目
    android操作线程各种方法解析
    SQLite数据库在多线程写锁文件的解决办法
    SILVERLIGHT 应急卫生模拟演练项目之childwindow
    SILVERLIGHT 应急卫生模拟演练项目之GRID布局
  • 原文地址:https://www.cnblogs.com/yizhinantian/p/551750.html
Copyright © 2020-2023  润新知