如何从GridView中检索值

编程入门 行业动态 更新时间:2024-10-24 18:17:58
本文介绍了如何从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中检索值

本文发布于:2023-11-24 03:24:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1623796.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:GridView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!