datagridview有疑问!! form1 有datagridview。form2 有textbox我在form2的textbox输入数据,datagridview里怎么显示出来同一个窗口里面,我能显示出来,多个窗口就不懂得显示了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 直接把form1的datagridview做成静态变量form1.datagridview... http://topic.csdn.net/u/20110407/19/c1068d69-7331-4d02-bc0b-f5ba7a5f8dd8.html 方法一:string value = this.textbox.Textform1 f1 = new form1(value)//注意在Form1那边写个构造函数f1.show();//此处为Form1的构造函数(首先在Form1里面定义 一个全局变量)string _value = "";publid form1(string value){ this._value = value;}然后将this._value 的值 绑定到 dataGridView中 OK?方法二:string value = this.textbox.Textform1 f1 = new form1()f1.Tag = value;f1.show();//在form1中获取Value 的值this.Tag 就是从form2中传过来的值将this.Tag的值绑定到DataGridView中,OK! 传值 MS013 ms = new MS013(); ms.PassMode = "1"; ms.flag = true; if (ms.ShowDialog() == DialogResult.OK) { txtPurchaseCD.Text = ms.OutDT.Rows[0]["PURCHASECD"].ToString(); checkType(); } 按照第一个方法,我到绑定dategridview那边又有疑问了。 public void databind() { try { string selstr = "select Book_ID as 单号,Book_Type as 收支类型, Book_Create_Date as 日期,Book_Money as 金额,Book_Re as 备注 from Book"; DataSet ds = new DataSet(); ds = db.GetDataSet(selstr, db); this.dataGridView1.DataSource = ds.Tables[0]; } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { ???= Convert.ToString(dataGridView1[1, dataGridView1.CurrentCell.RowIndex]).Trim(); }这应该怎么绑定?? 如何反射非公共的函数? 关于IntPtr赋值的问题 求:Socket传输的最大字节数 有人会用VS05的单元测试吗?我刚学,哪位高手可以教下我.如果教得好,我可以给RMB. 尊敬的各位前辈,我只熟悉VB+SQL,刚刚想转C#,请大家推荐入门书籍给我 小问题: treeView 的BeginEdit()问题 西安的程序员看过来,看过来? 请问如何捕获错误信息? 如何进行数据库备份? serialPort 串口发送指令失败,接收成功 如何让 DataGridView单元格赋值 和 手动输入 效果相同 ? 求遍历groupbox里的groupbox里的checkbox控件
form1.datagridview...
string value = this.textbox.Text
form1 f1 = new form1(value)//注意在Form1那边写个构造函数
f1.show();
//此处为Form1的构造函数(首先在Form1里面定义 一个全局变量)
string _value = "";
publid form1(string value)
{
this._value = value;
}
然后将this._value 的值 绑定到 dataGridView中 OK?方法二:string value = this.textbox.Text
form1 f1 = new form1()
f1.Tag = value;
f1.show();//在form1中获取Value 的值
this.Tag 就是从form2中传过来的值
将this.Tag的值绑定到DataGridView中,OK!
ms.PassMode = "1";
ms.flag = true;
if (ms.ShowDialog() == DialogResult.OK)
{
txtPurchaseCD.Text = ms.OutDT.Rows[0]["PURCHASECD"].ToString();
checkType();
}
按照第一个方法,我到绑定dategridview那边又有疑问了。 public void databind()
{
try
{
string selstr = "select Book_ID as 单号,Book_Type as 收支类型, Book_Create_Date as 日期,Book_Money as 金额,Book_Re as 备注 from Book";
DataSet ds = new DataSet();
ds = db.GetDataSet(selstr, db);
this.dataGridView1.DataSource = ds.Tables[0]; }
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
???= Convert.ToString(dataGridView1[1, dataGridView1.CurrentCell.RowIndex]).Trim();
}
这应该怎么绑定??