本文介绍了请澄清GridView.SelectedRow.Cells [1]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
string intno,intno2;
//Get the intno
intno = GridView1.SelectedRow.Cells[1].Text;
intno2 = GridView1.SelectedRow.Cells[7].Text;
//call the stored procedure
SqlCommand SqlCmd = new SqlCommand("sp_GetActLoanid", sqlcon);
SqlCmd.CommandType = System.Data.CommandType.StoredProcedure;
请解释参考 cells [1],cell [7 ]
re lang =sql> intno = GridView1.SelectedRow.Cells [1] .Text;
intno2 = GridView1.SelectedRow.Cells [7] .Text;
谢谢
please explain the references cells[1] , cell[7]
re lang="sql"> intno = GridView1.SelectedRow.Cells[1].Text;
intno2 = GridView1.SelectedRow.Cells[7].Text;
Thanks
推荐答案
datagridview1.SelectedRows["Col_Name"].Text;
datagridview1.SelectedRows[1].Text;
以上两行都做同样的工作,Cells [1],Cells [8 ]在上面的上下文中表示您正在尝试访问位于第2和第8位的当前聚焦的datagridview列的单元格。
both of the above line does the same work and "Cells[1],Cells[8]" in the above context means that you are trying to access cells of current focused column of datagridview at position 2 and 8.
这篇关于请澄清GridView.SelectedRow.Cells [1]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!