如何从GridView中检索值 [英] How to retrieve value from a gridview

查看:67
本文介绍了如何从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中检索值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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