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


  • 相关阅读:
    Qt5 webview加载本地网页
    pwiz, a model generator
    编译python3
    [转]Centos配置国内yum源
    ubuntu下apt-get update出现hash校验和错误
    《LINUX程序设计 第四版》 阅读笔记:(一)
    [转]https方式使用git保存密码的方式
    用python产生一个好的秘钥
    Ubuntu关闭图形界面
    Numpy中的矩阵计算
  • 原文地址:https://www.cnblogs.com/dashi/p/4034804.html
Copyright © 2011-2022 走看看