• 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的值

  • 相关阅读:
    Windows 10 PC 安装 Docker CE
    macOS 安装 Docker
    CentOS 安装 Docker CE
    Debian安装Docker
    ubuntu安装Docker
    docker基本概念
    linux docket
    Express框架
    Koa1 框架
    2018年03月刷题学习日记
  • 原文地址:https://www.cnblogs.com/a1991322/p/2759015.html
Copyright © 2020-2023  润新知