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;
            }


  • 相关阅读:
    <%!%>和<%%>的区别
    <jsp:param>传参乱码问题
    RedHat6.4 安装yum源
    J2EE中getParameter与getAttribute以及对应的EL表达式
    Ubuntu xrdp 遠端桌面連線 a
    Ubuntu SSH server 快速安裝和設定 a
    Ubuntu 12.04 快速安裝 Scrapy a
    Linux 壓縮與解壓縮指令備忘錄 a
    vim 設定快捷鍵為 [Ctrl] + [s] 存檔 a
    Linux 常用指令備忘錄 a
  • 原文地址:https://www.cnblogs.com/dashi/p/4034804.html
Copyright © 2011-2022 走看看