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

推荐订阅源

Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
Blog — PlanetScale
Blog — PlanetScale
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
U
Unit 42
I
InfoQ
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
B
Blog RSS Feed
Vercel News
Vercel News
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
T
Troy Hunt's Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
Jina AI
Jina AI
小众软件
小众软件
T
Threatpost
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
Scott Helme
Scott Helme
B
Blog
腾讯CDC
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
S
Schneier on Security
N
News and Events Feed by Topic
Microsoft Security Blog
Microsoft Security Blog
K
Kaspersky official blog
G
Google Developers Blog
T
Tor Project blog
PCI Perspectives
PCI Perspectives
S
Secure Thoughts
Google Online Security Blog
Google Online Security Blog
Latest news
Latest news
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
罗磊的独立博客

博客园 - chinaprg

干不下去了,准备出售公司了,有想要接手的吗 如何在3周让你的工资从5000+变10000+ 时隔6年后,我又回到博客园了 delphi关于小数位精度的问题 TExcelApplication,TExcelWorksheet,TExcelWorkbook用法 在客户处实施时几条常用运行命令备忘 堕落于游戏中的朋友可以看看了,打游戏偶尔还能搞点零花钱 路在何方 在b/s开发中经常用到的javaScript技术 C#中对注册表的操作 用C#实现生成PDF文档 C#在客戶端和服務端操作Excel文件 - chinaprg - 博客园 用C# 实现C/S模式下软件自动在线升级[转载,原作者:貓撲] c# 公式计算问题 转帖(http://topic.csdn.net/t/20060313/11/4610686.html) 关于C#下写的Web Service 服务在Delphi下调用时的问题 用C#快速往Excel写数据 - chinaprg - 博客园 常用javascript 常用javascript 网上看到的一篇颇有感触的文章,特意推荐给大家看看!
asp.net中Dbgrid更新和取消 命令同时出现的操作DEMO说明 - chinaprg - 博客园
chinaprg · 2007-01-16 · via 博客园 - chinaprg

在DBGRID中,常需要更新一行中的某一个字段,一个简便的方法如下:

在DBGRID加如下属性:

 OnCancelCommand = "dgReviews_Cancel" OnEditCommand = "dgReviews_Edit" OnUpdateCommand = "dgReviews_Update"

然后在服务器端加上对应的方法就OK了

protected void dgReviews_Update(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
  {
   TextBox content = (TextBox)e.Item.Cells[3].Controls[1];
   TextBox reply = (TextBox)e.Item.Cells[3].Controls[3];
   Response.Write();
  }

  protected void dgReviews_Edit(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
  {
   dgReviews.EditItemIndex = e.Item.ItemIndex;
   BindList(Request.QueryString["type"].ToString());
  }

  protected void dgReviews_Cancel(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
  {
   dgReviews.EditItemIndex = -1;
   BindList(Request.QueryString["type"].ToString());
  }