惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
C
Check Point Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
K
Kaspersky official blog
博客园 - 司徒正美
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Cisco Talos Blog
Cisco Talos Blog
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网
V
V2EX - 技术
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Spread Privacy
Spread Privacy
罗磊的独立博客
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
O
OpenAI News
Jina AI
Jina AI
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
I
InfoQ
D
Docker
P
Palo Alto Networks Blog
Recorded Future
Recorded Future
M
MIT News - Artificial intelligence
博客园 - Franky
B
Blog
Scott Helme
Scott Helme
博客园 - 叶小钗
D
DataBreaches.Net

博客园 - Niko

SQLServer使用注意规范 . windows2008 导出Excel 配置。 Web.config 数据库连接字符串加密 NHibernate.AdoNet.TooManyRowsAffectedException: Unexpected row count: 19; expected: 1 安装sql server 2008 注意事项 - Niko 添加 程序映射 链接服务器"(null)"的 OLE DB 访问接口 Microsoft Office Excel 不能访问文件 Win2008 检索 COM 类工厂中 CLSID 为 {000209FF-0000-0000-C000-000000000046} 的组件时失败解决方法 excel 汇入, SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问 - Niko 卸载 vs 2008 ASP.net 打印页面内容 - Niko - 博客园 asp.net 异步调用 MSSQL2005 建立分区 Asp.net2.0 defaultButton 不支持firefox解决方法 Rational Rose 安装破解, 和常见问题解决 Grid view 级联选择 - Niko Database diagram support objects cannot be installed because this database does not have a valid owner. ASP.NET动态生成控件问题。 - Niko - 博客园
Gridview 选中checkbox 时, 展开子节点, 同时选中父节点 - Niko
Niko · 2008-11-11 · via 博客园 - Niko

<script language="javascript">
        function postBackByObject()
        { debugger;
            var element = window.event.srcElement;
        
            if (element.tagName == "INPUT" && element.type == "checkbox")
            {                         
                var checkedState = element.checked;
                while (element.tagName != "TABLE")
                element = element.parentElement;
               
                //unfold the sub nodes
                var aaa = element.rows[0].cells.length - 2;            
                element.rows[0].cells[aaa].childNodes[0].click();
//                var treeviewLine = element.rows[0].cells[aaa].childNodes[0];
//                  
//                var nod = element.nextSibling;
//              
//                if (nod.tagName == "DIV")
//                {
//                    var length  = treeviewLine.id.substring(10,treeviewLine.id.length);
//                    TreeView_ToggleNode(TreeView1_Data,length,treeviewLine,' ',nod);
//                 }
               
                //check the parent nodes
                element = element.parentElement;            
                element = element.previousSibling;

                if (checkedState)
                {
                    if (element !=null)
                    {
                          if (element.tagName == "TABLE")
                          {                            
                                var checkboxIndex = element.rows[0].cells.length - 1;
                                var cell = element.rows[0].cells[checkboxIndex];
                                var checkboxes = cell.getElementsByTagName("INPUT");
                                if (checkboxes.length == 1)
                                    checkboxes[0].checked = checkedState;
                            }
                    }
                }
                if (element == null)
                return; 
            }
        }

后台: this.TreeView1.Attributes.Add("onclick", "postBackByObject()");