找到控件

Posted wonderfulviews

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了找到控件相关的知识,希望对你有一定的参考价值。

   protected void method_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                CustDropDownList ddlbaoxian = (CustDropDownList)sender;//通过sender找到
                int iCount = (ddlbaoxian.NamingContainer as ListViewDataItem).DataItemIndex;

                ListViewDataItem lvdi = lv5.Items[iCount]; //CustListView的ID
                string strPayItem = ddlbaoxian.SelectedItem.Value;
                CustDropDownList ddlbaoxians = (CustDropDownList)lvdi.FindControl("ddlbaoxian");
                CustLabel lblProp_MainInsKind = (CustLabel)lvdi.FindControl("lblProp_MainInsKind");
                ddlbaoxians.SelectByValue(strPayItem);
                String strlblProp_MainInsKind = lblProp_MainInsKind.Text.Trim();
            }
            catch (Exception ex)
            {
                SaveLog(ex);
                UnLock();
            }
        }

 

 

     //先找到CustListView
            for (int i = 0; i < lv3.Items.Count; i++)
            {
                ListViewDataItem ItemDetail = lv3.Items[i];
                CustListView lv1Rider = (CustListView)ItemDetail.FindControl("lv1Rider");
                if (lv1Rider != null)
                {
                    for (int j = 0; j < lv1Rider.Items.Count; j++)
                    {

以上是关于找到控件的主要内容,如果未能解决你的问题,请参考以下文章

如何在整个控件链中找到类型控件? [重复]

在方法中以编程方式移动控件警告“未找到方法”和“控件可能无法响应”

怎样找到并卸载控件(不是插件,不是软件,添加删除程序里找不到)谢谢

如何找到我添加到表单中的重叠控件?

我在哪里可以找到免费的 WPF 控件

如何在 Jquery 中找到用户控件的第二个子项? [关闭]