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


  • 相关阅读:
    自己封装的json工具类
    使用BigDecimal进行精确计算工具类
    keytool的使用
    自己封装的数字证书签名及签名验证方法,附带生成证书的语句
    用jxl导出数据到excel
    用jxl解析excel内容
    html的<marquee></marquee>标签实现滚动效果
    request、response 中文乱码问题与解决方式
    httpclient4.3.6/httpcore-4.4自己封装的工具类
    Tomcat优化总结
  • 原文地址:https://www.cnblogs.com/dashi/p/4034804.html
Copyright © 2011-2022 走看看