Exemplo n.º 1
0
        public override void CreateNewData(BizDataEventArgs e)
        {
            base.CreateNewData(e);

            ComboFieldEditor comboEidtor  = this.View.GetControl <ComboFieldEditor>("F_HS_SelectPrinter");
            List <EnumItem>  comboOptions = new List <EnumItem>();
            List <string>    printers     = PrintUtil.GetPrinterList();

            comboOptions.Add(new EnumItem()
            {
                EnumId = "", Value = "", Caption = new LocaleValue("")
            });                                                          // 空选项

            for (int i = 0; i < printers.Count; i++)
            {
                string ProjectName = printers[i];
                comboOptions.Add(
                    new EnumItem()
                {
                    EnumId = "" + i + 1, Value = ProjectName, Caption = new LocaleValue(ProjectName)
                });
            }

            comboEidtor.SetComboItems(comboOptions);
        }