如何获取datagrid当前行第一列 第二列 第三列 。。。的值? string ID =MyDataGrid.DataKeys[e.Item.ItemIndex].ToString(); 是获取当前行主键列的值。如何获取datagrid当前行第一列 第二列 第三列 的值? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void DataGrid1_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e){//打印出整行的值for(int i=0;i<e.Item.Cells.Count;i++){Response.Write(e.Item.Cells[i].Text);}//取此行第一列的值:string str1 = e.Item.Cells[0].Text;//取此行第二列的值:string str2 = e.Item.Cells[1].Text;//取此行第三列的值:string str3 = e.Item.Cells[3].Text;..................} this.dataGridView1.Rows[0].toString();.....this.dataGridView1.Rows[2]..... 发错,应该this.dataGridView1.Rows[0].Cells[0].toString() 遍历DataGrid获取datagrid当前行第一列 第二列 第三列 的值:MyDataGrid.Rows[i]["第一列"]MyDataGrid.Rows[i]["第二列"]MyDataGrid.Rows[i]["第三列"] 遍历DataGrid //取此行第一列的值: string str1 = e.Item.Cells[0].Text; //取此行第二列的值: string str2 = e.Item.Cells[1].Text; //取此行第三列的值: string str3 = e.Item.Cells[3].Text; .................. } 遍历DataGrid //取此行第一列的值: string str1 = e.Item.Cells[0].Text; //取此行第二列的值: string str2 = e.Item.Cells[1].Text; //取此行第三列的值: string str3 = e.Item.Cells[3].Text; 请教关于CSS根据ID设置服务端控件样式 asp.net为什么每次运行时要刷新才可以显示我修改后的页面 紧急求助!!! 组件服务-计算机-我的电脑-DCOM配置没有找到microsoft word文档 为什么上传exe文件会出错,其他就可以 怎样在Web应用程序的页面里面生成类似ComboBox的控件? asp.net,SQL Sever和AJAX之间有什么关系 这两种写法有什么不同点? postback的问题? 招聘熟悉Web方式下编程的软件工程师 一个关于dropdownlist取值的问题 如何换个头???
{
//打印出整行的值
for(int i=0;i<e.Item.Cells.Count;i++)
{
Response.Write(e.Item.Cells[i].Text);
}
//取此行第一列的值:
string str1 = e.Item.Cells[0].Text;
//取此行第二列的值:
string str2 = e.Item.Cells[1].Text;
//取此行第三列的值:
string str3 = e.Item.Cells[3].Text;
..................
}
.....
this.dataGridView1.Rows[2]
.....
this.dataGridView1.Rows[0].Cells[0].toString()
获取datagrid当前行第一列 第二列 第三列 的值:
MyDataGrid.Rows[i]["第一列"]
MyDataGrid.Rows[i]["第二列"]
MyDataGrid.Rows[i]["第三列"]
string str1 = e.Item.Cells[0].Text;
//取此行第二列的值:
string str2 = e.Item.Cells[1].Text;
//取此行第三列的值:
string str3 = e.Item.Cells[3].Text;
..................
}
string str1 = e.Item.Cells[0].Text;
//取此行第二列的值:
string str2 = e.Item.Cells[1].Text;
//取此行第三列的值:
string str3 = e.Item.Cells[3].Text;