商品检索的功能我能写,主要就是绑定DataGridVIew,但我想知道在调用这个控件时,怎么能像调用DataGridView控件那样,通过双击某个商品,返回一个商品的编码。这个事件怎么写,是把控件的双击事件public吗,还是别的方法,如设个公共变量,调用控件时读这个公共变量的值。
解决方案 »
- 方法返回值 有个问号,这是什么语法?
- WPF,如何在鼠标经过的地方,加一个放射状的白色高亮的跟随?
- ToolStrip包含控件,怎么实现上图片下文字?
- .Net 技术问题 求助
- 继承TextBox,限制输入字符长度的自定义控件怎么控制Text属性?
- C# Wpf/e
- DataGrid控件里面怎么让列的间距固定不变?谢谢
- ----子界面连接问题----
- 这个参数化的commandText有问题吗?
- 那位大侠有crystal enterprise Application sever 9 的注册号,给高分,给高分!!!!!!!!!!!!!!!!!!!!!!!!!!
- 释放流对象怎么把当前窗体里的对象都释放完了?
- 避免内存泄露
public string drvcpda_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (drvcpda.SelectedCells.Count > 0)
{
return drvcpda["cpID", e.RowIndex].Value.ToString();
}
else
{
return "";
}
}
给我的错误提示是返回值错误。
{
this.dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString(); this.dataGridView1.Rows[e.RowIndex].Cells["列名称"].Value.ToString();
}
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
this.dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString(); this.dataGridView1.Rows[e.RowIndex].Cells["列名称"].Value.ToString();
}