zoukankan      html  css  js  c++  java
  • 控件数据初始值绑定代码

            /// <summary>
            /// 把ListControl(BulletedList、CheckBoxList、DropDownList、ListBox、RadioButtonList)指定值的行进行选择
            /// </summary>
            /// <param name="DLTarget">要操作的目标</param>
            /// <param name="strValue">值</param>
            public static void SelectItemByValue(ListControl DLTarget, string strValue)
            {
                if (strValue == "")
                    return;


                int iCount = DLTarget.Items.Count;
                for (int i = 0; i < iCount; i++)
                    if (DLTarget.Items[i].Value.Trim() == strValue)
                    {
                        DLTarget.SelectedIndex = i;
                        break;
                    }
                return;
            }


            /// <summary>
            /// 把ListControl(BulletedList、CheckBoxList、DropDownList、ListBox、RadioButtonList)指定名称的行进行选择
            /// </summary>
            /// <param name="DLTarget">要操作的目标</param>
            /// <param name="strName">名称</param>
            public static void SelectItemByName(ListControl DLTarget, string strName)
            {


                int iCount = DLTarget.Items.Count;
                for (int i = 0; i < iCount; i++)
                    if (DLTarget.Items[i].Text == strName)
                    {
                        DLTarget.SelectedIndex = i;
                        break;
                    }
                return;
            }


  • 相关阅读:
    CSSText属性批量修改样式
    JS 学习(四)对象
    JS 学习(三)DOM
    JS语法(二)
    JS学习笔记(一)
    CSS3属性transition
    动画期间响应事件
    仿淘宝详情转场
    HTML 滚动标签<marquee>
    Oracle MySQL Server 安全漏洞
  • 原文地址:https://www.cnblogs.com/dashi/p/4034804.html
Copyright © 2011-2022 走看看