datagrid中行绑定的事件替代方法是什么 [英] what is the event alternative for rowbound in datagrid

查看:65
本文介绍了datagrid中行绑定的事件替代方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我正在使用datagrid.我想在加载行事件时访问datagrid的datatemplate中的控件.您能告诉我如何访问控件的ex标签值吗?


谢谢

Hi all

I am using datagrid . I want to access the controls in datatemplate of datagrid in loading row event . Can u please tell me how to access the control for ex label value.


Thanks

推荐答案

加载行事件是什么意思?网格数据绑定后,您可以按以下方式访问它们
What do you mean by loading row event ? Once your grid data is bounded you can access them as below
Foreach(GridViewRow gr in GridView1.Rows)
  {
   if(gr.RowType = DataControlRowType.DataRow)
    {    
     Label l = (Lable)gr.FindControl("mylabel");
     Response.Write(l.Value);  
    }
  }



注意:请检查语法.我只是在这里输入代码



Note: Please check for syntax. I just typed the code over here


这篇关于datagrid中行绑定的事件替代方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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