关于c#中获取值问题 点击删除时可以获得该行的标题 怎样获得??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在GridView1中有三列 第一列是标题 第二列是时间 第三列是CommandField 删除 我想单击该行的删除时获得该行的标题 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { DataGridViewColumn column = dataGridView1.Columns[e.ColumnIndex]; if (e.ColumnIndex==3 ) { string str_标题 = this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); MessageBox.Show(str_标题); } } } 在删除事件中写: string str_标题 = this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); Label aa = (Label)gvShow.Rows[0].FindControl("lblCLLBIE"); this.Label1.Text = aa.Text;这样试一下看看行不行?? e.ColumnIndex == 2 是从第0列开始计算的。 这样的表该怎么设计好? C# WinForm 应用程序入口错误 请问谁使用过Basler的aca 1300-30gc工业照相机啊 调用事件 C# UdpClient接收消息问题? 新手问题:关于 IHTMLElement 接口 在引用一个OCX控件中,对其一个类实例化时提示"不可访问,受保护限制",怎么办。 关于C#与三菱FX-3U通讯的问题 请过来人推荐一本 关于出 C# ‘WEB’方面的书? 关于水晶报表的数据源连接问题,急、急、急、急! 关于登录客户端保存登录信息问题 求完整的论坛源码和博客源码,c#的,谢谢!!
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0)
{
DataGridViewColumn column = dataGridView1.Columns[e.ColumnIndex];
if (e.ColumnIndex==3 )
{
string str_标题 = this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
MessageBox.Show(str_标题);
}
}
}
string str_标题 = this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
Label aa = (Label)gvShow.Rows[0].FindControl("lblCLLBIE");
this.Label1.Text = aa.Text;这样试一下看看行不行??
e.ColumnIndex == 2 是从第0列开始计算的。