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

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
V2EX - 技术
V2EX - 技术
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Secure Thoughts
Forbes - Security
Forbes - Security
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
Apple Machine Learning Research
Apple Machine Learning Research
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Webroot Blog
Webroot Blog
W
WeLiveSecurity
Blog — PlanetScale
Blog — PlanetScale
G
Google Developers Blog
Last Week in AI
Last Week in AI
月光博客
月光博客
H
Help Net Security
PCI Perspectives
PCI Perspectives
Security Archives - TechRepublic
Security Archives - TechRepublic
Hugging Face - Blog
Hugging Face - Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
有赞技术团队
有赞技术团队
T
Troy Hunt's Blog
Google DeepMind News
Google DeepMind News
Hacker News: Ask HN
Hacker News: Ask HN
Microsoft Security Blog
Microsoft Security Blog
N
News and Events Feed by Topic
Project Zero
Project Zero
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LangChain Blog
P
Privacy & Cybersecurity Law Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
I
Intezer
H
Hacker News: Front Page
Recent Announcements
Recent Announcements
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - Franky
T
Threat Research - Cisco Blogs
Spread Privacy
Spread Privacy
博客园 - 【当耐特】
美团技术团队
Schneier on Security
Schneier on Security
D
Docker
Scott Helme
Scott Helme
L
LINUX DO - 最新话题
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
aimingoo的专栏
aimingoo的专栏
L
Lohrmann on Cybersecurity

博客园 - 武广敬

There is no mode by that name loaded / mode not given 产生原因(个案) 使用VS调试JS 使用U盘安装Windows Server2008 德广火车票助手登录12306代码详解-登录 德广火车票助手源码 请各位前辈给些建议 用户中心 - 博客园 vs2008 SmartDevice 程序 访问Internet时出错 提示:未能建立与网络的连接。解决方案 关于微软有自增列父子表更新程序的问题 免费的网上问卷调查程序 在线HTML标签验证工具.很好用的. 微软扶持软件公司计划 使用Visual Studio生成安装程序并设定连接字符串及其他自定义操作. - 武广敬 - 博客园 新鲜出炉的Asp.Net MVC电子书 我理解的云计算 设定了窗口的AcceptButton及CancelButton点击时无动作的原因 使用电脑+MODEM 订火车票 (可以一直自动重拨) 黄牛党/铁路内部人员不得进入!!! UI设计注意点 可以让DataGridView中多个ComboBox级联的工具类-初版 通过反射得到对象
DataGridViewComboBoxColumn 可以让用户输入并自动匹配选项的问题 [问了很多人,找了很多站都没得到答案,所以只好放首页,请管理员体谅.谢谢!]
武广敬 · 2008-12-24 · via 博客园 - 武广敬

使用以下方法解决了让用户输入并自动匹配选项的问题.但是发现如果全部使用键盘输入的话.当焦点移出此单元格后此单位元格未选中任何一项.显示为空.原因见代码中...

Code

        
private void dgvInfoPerson_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
        {
            
if (dgvInfoPerson.CurrentCellAddress.X == dgvInfoPerson.Columns["colCboDeptNo"].Index)
            {
                cbo 
= e.Control as ComboBox;
                
if (cbo != null)
                {
                    cbo.DropDownStyle 
= ComboBoxStyle.DropDown;
                    cbo.AutoCompleteMode 
= AutoCompleteMode.SuggestAppend;
                }
            }
        }
private void dgvInfoPerson_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
        {
            
if (dgvInfoPerson.CurrentCellAddress.X == dgvInfoPerson.Columns["colCboDeptNo"].Index)
            {
                
//问题出在这里.如果你输入的是ValueMember的值的话就没问题.但你如果输入的是DisplayMember的值的话就不会选中.
                
//如ValueMember="MAN" DisplayMember="管理部",如果你在此单元格输入MAN就没问题,但输入管理部就不会选中.但用户就应该是输入管理部
                  
//而不是输入MAN.

                dgvInfoPerson.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = e.FormattedValue;
            }
        }

截图

 Demo下载:http://download.csdn.net/source/903727
已经搜过很多地方了.都没好的解决方案.还请各位有经验的前辈指点迷津.谢谢!