请澄清GridView.SelectedRow.Cells [1] [英] Please clarify GridView.SelectedRow.Cells[1]

查看:566
本文介绍了请澄清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

推荐答案

先生,上面的代码Cells [1],Cells [8]用于从datagridview获取数据。让我举一个简单的例子: -

sir, the above code "Cells[1],Cells[8]" are used to get data from the datagridview. let me give you another simple example for this:-
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]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆