ASP ........ HELP ........ PLZ [英] ASP.................HELP ........ PLZ

查看:43
本文介绍了ASP ........ HELP ........ PLZ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

:(((如何从gridview的

:(( How to get more selectdata from a gridview''s

推荐答案

取决于您如何设置GridView.

如果要单击页面底部的单个按钮来获取数据,则需要循环遍历 GridView1.Rows 中的每个 DataGridRow 并搜索使用 FindControl()进行相关控制.

另一种方法是在每行上都有一个按钮(因此是编辑或删除样式按钮).而不是遍历每一行.您可以使用GridView可用的 ItemCommand 事件.

如果您需要这些方法的示例,请告诉我.
Depends on how you have your GridView setup.

If you want to get the data on click of a single button at the bottom of the page you would need to loop each of the DataGridRow in GridView1.Rows and search for the relavant control using FindControl().

Another way is to have a button on each row (so a edit or delete style button). Instead of looping thru each of the rows. You can use the ItemCommand event available to the GridView.

If you require examples of these methods please let me know.


因为您已经知道该行之后的行,因此无需循环收集.

您应该能够执行以下操作.

Because you already know the row your after this is no need to loop the collection.

You should be able to do something like the following.

void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
    GridViewRow selectedRow = GridView1.SelectedRow;

    Label label = (Label)selectedRow.FindControl("Label1");
}


protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
   {


foreach (GridViewRow row in rowArray)
   {
   j++;
           if (j == GridView1.SelectedRow.RowIndex)
   {
   Label2.Text = row.Cells[5].Text;
            }

       }






标签7.text为空


在运行程序中返回0




或输入此代码

GridViewRow行= GridView1.SelectedRow;
Label2 .Text = row.Cells [2] .Text;


在这段代码中label7.text为空,请帮助我:confused::((






lable 7.text is empty


return 0 in run program




OR TYPE THIS CODE

GridViewRow row = GridView1.SelectedRow;
Label2 .Text = row.Cells[2].Text;


in this code label7.text is empty plz help me:confused: :((


这篇关于ASP ........ HELP ........ PLZ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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