本文介绍了如何从GridView中检索值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用modalviewextender(在ajax中),其中我有一个gridview,而我有一个 选择命令按钮.现在我想要的是:-在单击任何选择命令按钮时,我应该能够再次检索该特定行的值(例如,在cell [0]中) 其次,应该如何将controlID放置在属性"OkControlID"的前面,以便它获取该特定单元格的值. 快速帮助将不胜感激. 问候.
I am using a modalviewextender (in ajax)in which i have a gridview and in that i have a Select Commandbutton. Now what i want is :- On clicking on any of the select commandbutton, i should be able to reteieve the value againest that particulr row (for example- in cell[0] ) Secondly, How controlID should i place in front of the property -"OkControlID" so that it gets the value of that particular cell. Quick help would be appreciated. Regards.
推荐答案行命令 protected void cmd_transfer(object sender, GridViewCommandEventArgs e) { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridView1.Rows[index]; ViewState["fileno"] = row.Cells[2].Text; this.modal1.Show(); }
代码项目-常见问题系列1: ASP.Net GridView [ ^ ]可能会帮助您. Code Project - Frequently Asked Questions Series 1: The ASP.Net GridView[^] might help you out.
更多推荐
如何从GridView中检索值
发布评论