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

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
Martin Fowler
Martin Fowler
A
About on SuperTechFans
H
Help Net Security
F
Full Disclosure
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
IT之家
IT之家
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
H
Heimdal Security Blog
博客园_首页
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Tailwind CSS Blog
Recent Announcements
Recent Announcements
B
Blog RSS Feed
Last Week in AI
Last Week in AI
V2EX - 技术
V2EX - 技术
The Register - Security
The Register - Security
Security Archives - TechRepublic
Security Archives - TechRepublic
G
GRAHAM CLULEY
美团技术团队
S
Securelist
MyScale Blog
MyScale Blog
Vercel News
Vercel News
L
LINUX DO - 最新话题
Hacker News: Ask HN
Hacker News: Ask HN
W
WeLiveSecurity
M
MIT News - Artificial intelligence
宝玉的分享
宝玉的分享
月光博客
月光博客
Attack and Defense Labs
Attack and Defense Labs
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Forbes - Security
Forbes - Security
罗磊的独立博客
O
OpenAI News
AI
AI
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
雷峰网
雷峰网
S
Security @ Cisco Blogs
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
P
Proofpoint News Feed
Webroot Blog
Webroot Blog
V
Visual Studio Blog

博客园 - PENGHAO-X

indows 8上强制Visual Studio以管理员身份运行 jQuery中浏览器版本判断的一个BUG,此BUG已影响到jqModal,thickbox等多个jQuery插件的应用 [注意]你的系统中存在这个BUG吗?(正则表达式验证) SQL 2005 except,intersect [收藏 ]针对IE网页浏览器不同版本解释的CSS或javascript .NET Framework 3.5中序列化成JSON数据及JSON数据的反序列化,以及jQuery的调用JSON Windows 2003 远程桌面连接出错解决办法。(由于协议错误,会话将被中断。请重新连接到远程计算机。) CSS hack:区分IE6,IE7,firefox 全国哀悼日 灰色CSS滤镜 将字符串对转换成字典(临时表)的自定义函数(SQL) [转载][收藏][新]正则表达式30分钟入门教程[2007-8-3 V2.21] 获取表中新记录(下一条记录)的主键值的存储过程 .NET 2.0中,配置文件app.config的读写(VS2005,C#) 如何进入程序设计的领域 用ASP设计购物推车 - PENGHAO-X - 博客园 XHTML 1.0 参考 JS代码--HTML自动转为JS代码 - PENGHAO-X - 博客园 文本输入限制 - PENGHAO-X - 博客园 JS代码--选择日期
ListView 中的一个低级 BUG
PENGHAO-X · 2008-06-26 · via 博客园 - PENGHAO-X

今天在使用ListView编辑记录时,遇到问题:
ItemEditing事件中使用EditItem属性经常为null,

        protected void ListView1_ItemEditing(object sender, ListViewEditEventArgs e)
        {
            ListView1.InsertItemPosition 
= InsertItemPosition.None;
            ListView1.EditIndex 
= e.NewEditIndex;//e.NewEditIndex为0时,ListView1.EditItem总会为null
            if (ListView1.EditItem != null)
            {
        
//
            }
    }

调试了半天才发现,只要当EditIndex=0时(即编辑第一条记录)EditItem属性总是为空
用Reflector反射ListView的EditItem查到原因代码如下:(this._editIndex > 0应该改为this._editIndex >= 0)

public virtual ListViewItem EditItem
{
    
get
    {
        
if ((this._editIndex > 0&& (this._editIndex < this.Items.Count))
        {
            
return this.Items[this._editIndex];
        }
        
return null;
    }
}

后来Google了一下,发现园子里早有朋友反映了这个BUG (第一次用ListView,就抓到BUG),可MS到目前仍未修复。。。
临时的解决方法:用ListView1.Items[ListView1.EditIndex]代替ListView1.EditItem