zoukankan      html  css  js  c++  java
  • 小项目之总结CheckBoxList读取值

    小项目之总结CheckBoxList读取值

           取值
            
    string _strvalue="";
              
    for (int i = 0; i < chk_td.Items.Count; i++)
                {
                    
    if (chk_td.Items[i].Selected == true)
                    {
                        _strvalue
    += chk_td.Items[i].Value + "|";
                    }
                }
                
    if (_strvalue.Length > 1) _strvalue = _strvalue.Substring(0, _strvalue.Length - 1);

         读取
                   
    string aa = 数据库读取值;
                    
    string[] strtemp = aa.Split('|');
                    
    foreach (string str in strtemp)
                    {
                        
    for (int i = 0; i < chk_td.Items.Count; i++)
                        {
                            
    if (chk_td.Items[i].Value == str)
                            {
                                chk_td.Items[i].Selected 
    = true;
                            }
                        }
                    }
  • 相关阅读:
    效率分页代码
    serialPort控件(串口通信)
    C#事件DEMO
    泛型类
    简单的登陆页面
    hdu 1342+hdu 2660+hdu 2266+hdu 1704+hdu 1627+hdu 1539
    hdu 3987(求割边最小的最小割)
    hdu 1907(尼姆博弈)
    hdu 2149+hdu 1846(巴什博弈)
    hdu 2516(斐波那契博弈)
  • 原文地址:https://www.cnblogs.com/sendling/p/1423480.html
Copyright © 2011-2022 走看看