zoukankan      html  css  js  c++  java
  • 不能在DropDownList 中选择多个项

    在绑定DropDownList时如果出现多次绑定,会出错以下错误:

    “不能在DropDownList 中选择多个项”

    经了解,只需要在选中值是清空选择即可:xxDropDownList.ClearSelection() ;

      /// <summary>
        /// 设定选中项
        /// </summary>
        /// <param name="list"></param>
        public static void SetListControl(ListControl list, string selectedValues)
        {
            if (string.IsNullOrEmpty(selectedValues))
                return;
            list.ClearSelection();
            foreach (string var in selectedValues.Split(','))
            {
                string value = var.Trim();
                if (value.Length > 0)
                {
                    foreach (ListItem item in list.Items)
                    {
                        if (item.Value == value)
                        {
                            item.Selected = true;
                            break;
                        }
                    }
                }
            }
        }

  • 相关阅读:
    zimg
    ffmpeg P016 P010 YUV444P16LE 的打印的像素值
    zimg 使用
    P010LE P016LE YUV420P10LE
    如鹏网学习笔记(八)CSS
    对dui界面 组件 hook的通杀方案
    Python 中str 与 bytes 数据结构转换
    Tensorflow 老版本的安装
    Java string和各种格式互转 string转int int转string
    电脑黑屏
  • 原文地址:https://www.cnblogs.com/samlin/p/5889636.html
Copyright © 2011-2022 走看看