如何在FormView ItemTemplate中查找控件 [英] How to Find Control in FormView ItemTemplate

查看:77
本文介绍了如何在FormView ItemTemplate中查找控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在formview中找到gridview控件

看起来我在formview中找到了控件但是我无法绑定

数据来了来自数据集



I am trying to find the gridview control placed in formview
It looks like i have found the control in formview but I am not able to bind the
data coming from the dataset

GridView gvSizePrice = (GridView)fvProduct.FindControl("gdvSizePrice");
             gvSizePrice.DataSource = ds;
             gvSizePrice.DataBind();





可以帮助



can some one help

推荐答案

尝试



try

fvProduct.Row.FindControl("gdvSizePrice");





谢谢,

Hemant



Thanks,
Hemant


更加动态(在FormView事件中,如DataBound):



GridView gv =(GridView)((FormView)发送者).Row.FindControl(GridView1);
A little more dynamic (when in a FormView event, like DataBound):

GridView gv = (GridView)((FormView)sender).Row.FindControl("GridView1");


这篇关于如何在FormView ItemTemplate中查找控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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