zoukankan      html  css  js  c++  java
  • Dev 控件lookUpEdit的数据绑定及其获取从UI界面赋给lookupedit的值

    lookUpEdit1数据绑定:
               lookUpEdit1.Properties.DataSource = dt;
               lookUpEdit1.Properties.Columns.Add(new LookUpColumnInfo("DayPropName", "日期类型"));
               lookUpEdit1.Properties.DisplayMember = "DayPropName";
               lookUpEdit1.Properties.ValueMember = "DayProp";
               lookUpEdit1.Properties.TextEditStyle = TextEditStyles.DisableTextEditor; //默认不可编辑
               lookUpEdit1.ItemIndex = 0; //默认显示第一行

    把GridView中的数据绑定到lookUpEdit1的数据动态绑定(随着导航条变化):

    DataRow dr = gridView_SpecialDay.GetFocusedDataRow();
                if (dr != null)
                {
                    string DayPropstr = dr["DayProp"].ToString();//(是ValueMember的值)
                    string Adatestr = dr["ADate"].ToString();
                    if (Adatestr != "")
                    {
                        dateEdit_Day.EditValue = Convert.ToDateTime(Adatestr).ToString("yyyy/MM/d");
                    }
                    if (DayPropstr != "")
                    {
                        lookUpEdit1.EditValue=byte.Parse( DayPropstr); //要与数据库中的类型相同(注:绑定lookupEdit)(数据库中的类型是tinyint(无符号整型与.Net中的byte类型对应))
                    }
                }

      lookUpEdit1.EditValue不是字符类型; lookUpEdit1.text是字符类型

    3.获取 中界面赋予的 lookUpEdit1值

    spmodel.DayProp =int.Parse( lookUpEdit2_DayProp.EditValue.ToString().Trim()); //实质是获取到了ValueMember的值

  • 相关阅读:
    UICollectionView添加 HeaderView FooterView
    Swift-UIDynamic初见
    Swift归档
    通知NSNotication&通知中心NSNoticationCenter
    iOS沙盒
    lldb-320.4.152﹣Debugger commands:
    UIPickerView採摘控件的學習
    hive的优化
    zookeeper简易配置及hadoop高可用安装
    hadoop组件概念理解
  • 原文地址:https://www.cnblogs.com/a1991322/p/2759015.html
Copyright © 2011-2022 走看看