logo

关于 捕捉DataGrid的双击事件(C#版本) 的评论:

评论日期:2004年03月02日 00:00:00 评论人:
虽然代码很多,但却运行不了,强人,在你写的时候是否测试过啊
评论日期:2004年03月10日 00:00:00 评论人:
评论日期:2004年03月25日 00:00:00 评论人:apc001
哈哈,
不要晕~
可能是你哪里错了吧?

我根本就没有详细看这个.

我没有用TEXTBOX那种的方法.
直接用的,那头列的双击事件.....

也是自己捕捉
评论日期:2004年04月07日 00:00:00 评论人:sdf
可以的呀,好用呢
评论日期:2004年07月02日 00:00:00 评论人:
很多错误!
评论日期:2004年12月17日 00:00:00 评论人:
  这个例子相当不错,没什么问题的。
评论日期:2005年01月20日 00:00:00 评论人:送外卖的
那么动态邦定的情况下如何获得双击事件呢?
评论日期:2005年01月27日 00:00:00 评论人:zhouyong63
我用c#,想将绑定控件中修改过的数据,保存到数据源中,可不能实现。代码如下,请帮忙修改。
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;


namespace lhlr
{
/// <summary>
/// Frmkchlr 的摘要说明。
/// </summary>
public class Frmkchlr : System.Windows.Forms.Form
{
        private System.Windows.Forms.DataGrid dataGrid1;

private System.Windows.Forms.Button btngx;

private SqlCommandBuilder sqlbd;
private SqlDataAdapter da;

private System.Data.DataSet dataSet1;
private System.Data.SqlClient.SqlCommand sqlCommand2;

private void Frmkchlr_Load(object sender, System.EventArgs e)
{
string connstr="Data Source=10.4.12.1;Initial Catalog=wlgsdb;User ID=sa;Password=";
SqlConnection mycon=new SqlConnection(connstr);
try
{
mycon.Open();
string str="select chh as '车号',rcpm as '入厂品名',lhrcsj as '入厂时间',lhjcsj as '接车时间',lhjrcz as '接入车站',lhjz as '进站',lhfcsj as '绿化发车时间',jdfcsj as '嘉东发车时间',chz as '车种',pzch as '普专车' from lhchb  where jbjrsj is null and jbjrsj is null ";

sqlCommand2=new SqlCommand(str,mycon);

da=new SqlDataAdapter();
da.SelectCommand=sqlCommand2;

sqlbd=new SqlCommandBuilder(da);

da.Fill(dataSet1,"lhchb");

this.dataGrid1.SetDataBinding(dataSet1,"lhchb");
    
    mycon.Close();

}
catch(Exception ex)
{
MessageBox.Show("查看数据产生一个错误:"+ex.Message);
}

}
private void btngx_Click(object sender, System.EventArgs e)
{
                    this.da.Update(dataSet1,"lhchb");


}
}
}
评论日期:2006年06月05日 00:00:00 评论人:老蒋
各位说有错误的大哥先看清楚代码,这个是WinForm下的程序,不是WebForm的,我试过了,直接新建工程,拷贝代码就能运行。
评论日期:2007年02月02日 00:00:00 评论人:caipei
谢谢,很好的例子,帮助我解决了问题
评论日期:2008年06月03日 00:00:00 评论人:Jenny_Ming
感谢了…我可是找了很久…总算让我看到你的分享…感谢致极!!
评论日期:2008年12月24日 15:58:19 评论人:byhum
DataSet myDataSet  =  new  DataSet("myDataSet");    
        
string sql1="select id as 序号,address as 网址,name as 名称,bz as 说明 from usermanage"; 
DataTable  dt  =  new  DataTable("Customers"); 
dt=DB.DataAccess.GetAccessData(sql1); 
    
myDataSet.Tables.Add(dt);    
  
dataGrid1.SetDataBinding(myDataSet,  "Customers");  

我按如上方法想改成动态数据绑定的,为什么总是弹出“无法创建字段Customers的子列表”?
评论日期:2011年02月05日 12:38:13 评论人:tramadol 120 pills
I just sent this post to a bunch of my friends as I agree with most of what you’re saying here and the way you’ve presented it is awesome.
评论日期:2011年02月05日 17:17:39 评论人:120 cod tablet tramadol
I just book marked your blog on Digg and StumbleUpon.I enjoy reading your commentaries.
评论日期:2011年02月06日 23:38:12 评论人:dosage tramadol in veterinary medicine
I’ve been visiting your blog for a while now and I always find a gem in your new posts.  Thanks for sharing.
评论日期:2011年02月07日 19:22:07 评论人:tapering off tramadol
Very Interesting Post! Thank You For Thi Blog!
发表评论:(由于众所周知的原因,评论需要审核后才能显示,请勿重复发评论。谢谢!!)
标题:
用户名:
内容:
验证码: 请输入右边图像中的文字。验证码