• Ext.Net中动态创建Combox及动态添加其Items【总结】


                    Ext.Net.ComboBox combox = new Ext.Net.ComboBox();
                    combox.ID = TCMUtility.GuidToControlID(formField.SYSID, "field");
                    combox.Height = Unit.Parse("25px");
                    combox.Width = Unit.Parse("280px");
                    combox.LabelAlign = LabelAlign.Right;
                    combox.FieldLabel = formField.FIELDNAME;
                    combox.X = 0;
                    combox.Y = numY;
                    combox.Editable = false;
                    combox.Resizable = true;
                    combox.AllowBlank = formField.ALLOWNULL;

                    JsonReader ar = new JsonReader();
                    RecordField rf = new RecordField("DATA", RecordFieldType.String);
                    RecordField rf2 = new RecordField("VALUE", RecordFieldType.String);
                    ar.Fields.Add(rf);
                    ar.Fields.Add(rf2);
                    Store myStore = new Store();
                    myStore.Reader.Add(ar);
                   

                    //如果是下拉框,需要把所有下拉值填充进去,以便用户选择
                    List<StringEntity> list = new List<StringEntity>();
                    string valueList = formField.VALUELIST ?? "";
                    if (valueList.Length != 0)
                    {
                        string[] numValue = valueList.Split(';');
                        for (int j = 0; j < numValue.Count(); j++)
                        {
                            StringEntity value = new StringEntity();
                            value.DATA = numValue[j].ToString();
                            value.VALUE = numValue[j].ToString();
                            list.Add(value);
                        }

                        myStore.DataSource = list;
                        myStore.DataBind();                                
                    }
                    combox.Store.Add(myStore);
                    combox.DisplayField = "DATA";
                    combox.ValueField = "VALUE";

  • 相关阅读:
    Navicat for SQLite之外键(05)
    UIButton
    多线程中的API
    UIImageView
    IOS中实现单例
    IOS中的多线程【二】— NSOperation和NSOperationQueue
    IOS中的多线程
    OC中新增的数据类型
    【转】c# DBF数据库导入导出实例
    【经验】学习新知识的经验
  • 原文地址:https://www.cnblogs.com/alexzp/p/2355794.html
Copyright © 2020-2023  润新知