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

推荐订阅源

N
News and Events Feed by Topic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
S
SegmentFault 最新的问题
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
C
Cisco Blogs
博客园 - 叶小钗
P
Privacy International News Feed
Jina AI
Jina AI
Apple Machine Learning Research
Apple Machine Learning Research
T
Threatpost
IT之家
IT之家
博客园 - 聂微东
Know Your Adversary
Know Your Adversary
Help Net Security
Help Net Security
罗磊的独立博客
I
Intezer
S
Schneier on Security
博客园_首页
C
CERT Recently Published Vulnerability Notes
雷峰网
雷峰网
Cisco Talos Blog
Cisco Talos Blog
宝玉的分享
宝玉的分享
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Webroot Blog
Webroot Blog
TaoSecurity Blog
TaoSecurity Blog
MyScale Blog
MyScale Blog
P
Privacy & Cybersecurity Law Blog
T
The Exploit Database - CXSecurity.com
PCI Perspectives
PCI Perspectives
Security Latest
Security Latest
H
Heimdal Security Blog
S
Secure Thoughts
Hacker News: Ask HN
Hacker News: Ask HN
Y
Y Combinator Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Microsoft Security Blog
Microsoft Security Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
SecWiki News
SecWiki News
The GitHub Blog
The GitHub Blog
A
Arctic Wolf
A
About on SuperTechFans
aimingoo的专栏
aimingoo的专栏
T
Threat Research - Cisco Blogs
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

博客园 - jdmei520

2D纹理与3D模型共存时的渲染问题 Adventure Works示例数据库介绍 基于 SOA 的监测、诊断与预测系统架构 基于SOA的设备智能维护系统架构设计及实现 WCF基础知识问与答 (转载) 学习资源 Wcf概述 用Visual C#创建Windows服务程序 VS2005没有源代码管理选项和菜单 - jdmei520 - 博客园 RFID射频识别技术 微软RFID开发平台BizTalk资料收集 未能建立与LOCAL的连接——Telnet成功,这就说明是你自己造成的 使用NUnit在.Net编程中进行单元测试 Enterprise Library 企业库 ListView控件(在ListView失去焦点的情况下仍然保持Item高亮) 控制图纸多线相交交点凸起(Control PolyLine Bulge open and close ) 常用数据库访问接口 广州日报新媒体发展战略解析(转) 如何编程控制动态块的参数、动作
TextBox 绑定表的数字类型字段,清除文本框内容时,焦点不能移出文本框的解决方法 - jdmei520 - 博客园
jdmei520 · 2010-03-22 · via 博客园 - jdmei520

代码

Binding bind = new Binding("Text", bindsourse, name, true, DataSourceUpdateMode.OnValidation, DBNull.Value);
                            tb.DataBindings.Add(bind);
                            bind.DataSourceNullValue 
= DBNull.Value;
                            
if (((System.Data.DataView)bindsourse.DataSource).Table.Columns[name].DataType.FullName == "System.Decimal")
                            {
                                
//下面两句用于处理数值型字段绑定无法设置空值问题
                                bind.Format += new ConvertEventHandler(bind_Format);
                                bind.Parse 
+= new ConvertEventHandler(bind_Parse);
                            }
void bind_Format(object sender, ConvertEventArgs e)//绑定控件时发生
        {
            
if (e.Value == DBNull.Value)
                e.Value 
= "";
        }
void bind_Parse(object sender, ConvertEventArgs e)//控件值更改时发生
        {
            
if (e.Value.ToString() == "")
                e.Value 
= DBNull.Value;
        }

posted on 2010-03-22 16:12  jdmei520  阅读(524)  评论()    收藏  举报