private void CreateControls(IList<QueryGroupItem> groupItems)
        {
            this.layoutControlContainer.BeginUpdate();
            try
            {
                this.layoutControlGroupMain.Clear();
                foreach (var groupItem in groupItems)
                {
                    var combo = new CheckedComboBoxEdit {Name = "checkedCombo" + groupItems.IndexOf(groupItem)};
                    combo.Properties.SelectAllItemVisible = true;
                    combo.Properties.SelectAllItemCaption = "Выбрать все";
                    combo.Properties.DropDownRows = 10;
                    combo.Properties.DisplayMember = "Key";
                    combo.Properties.ValueMember = "Value";
                    combo.Properties.DataSource = groupItem.QueryDictionary.ToList();
                    EventHandler popupHandler = null;
                    popupHandler = (sender, args) =>
                    {
                        var popupContainer = (PopupContainerForm) ((IPopupControl) sender).PopupWindow;
                        _listBoxQueries = popupContainer.Controls[3].Controls[0] as CheckedListBoxControl;

                        if (_listBoxQueries == null) 
                            return;
                        _listBoxQueries.ItemCheck += (o, eventArgs) =>
                        {
                            combo.Text = string.Join("; ",
                                _listBoxQueries.CheckedIndices.OfType<int>().Select(t => _listBoxQueries.GetItemText(t)));
                            ListBoxQueriesOnItemCheck(o, eventArgs);
                        };

                        combo.Popup -= popupHandler;
                    };
                    combo.Popup += popupHandler;

                    combo.Closed += (sender, args) =>
                    {
                        combo.Text = string.Join("; ",
                            _listBoxQueries.CheckedIndices.OfType<int>().Select(t => _listBoxQueries.GetItemText(t)));
                    };
                    var layoutItem = new LayoutControlItem()
                    {
                        Text = groupItem.Head,
                        TextLocation = Locations.Top,
                        Control = combo
                    };
                    layoutItem.AppearanceItemCaption.Font = new Font("Segoe UI", 9);
                    this.layoutControlGroupMain.Add(layoutItem);
                }
                if (_queryListOthers.Any())
                {
                    var checkAllBox = new CheckEdit
                    {
                        CheckState = CheckState.Unchecked,
                        Text = "Выбрать все"
                    };
                    checkAllBox.Properties.AllowGrayed = true;
                    checkAllBox.CheckedChanged += (sender, args) =>
                    {
                        if (checkAllBox.Checked)
                        {
                            _listBoxOtherQueries.CheckAll();
                        }
                        else
                        {
                            _listBoxOtherQueries.UnCheckAll();
                        }
                    };
                    _listBoxOtherQueries = new CheckedListBoxControl
                    {
                        DisplayMember = "title",
                        ValueMember = null,
                        DataSource = _queryListOthers,
                        Name = "listBoxOtherQueries",
                        CheckOnClick = true,
                        AutoSizeInLayoutControl = true
                        //MinimumSize = new Size(0, 200)
                    };
                    
                    _listBoxOtherQueries.ItemCheck += (sender, args) =>
                    {
                        if (_listBoxOtherQueries.CheckedItemsCount < _listBoxOtherQueries.ItemCount)
                            checkAllBox.CheckState = CheckState.Indeterminate;
                        else if (_listBoxOtherQueries.CheckedItemsCount == 0)
                            checkAllBox.CheckState = CheckState.Unchecked;
                        else
                            checkAllBox.CheckState = CheckState.Checked;
                            
                        ListBoxQueriesOnItemCheck(sender, args);
                    };

                    var layoutItem = new LayoutControlItem()
                    {
                        Text = "Остальные запросы",
                        TextLocation = Locations.Top,
                        Control = _listBoxOtherQueries
                    };
                    layoutItem.AppearanceItemCaption.Font = new Font("Segoe UI", 9);
                    this.layoutControlGroupMain.Add(layoutItem);
                    this.layoutControlGroupMain.AddItem(new LayoutControlItem()
                    {
                        TextVisible = false,
                        Control = checkAllBox
                    });
                    
                }
            }
            finally
            {
                this.layoutControlContainer.EndUpdate();
            }
        }
Exemplo n.º 2
0
 private void cbART_Type_Closed(object sender, DevExpress.XtraEditors.Controls.ClosedEventArgs e)
 {
     CheckedComboBoxEdit edit = sender as CheckedComboBoxEdit;
     //if (e.CloseMode == PopupCloseMode.ButtonClick)
     //    MessageBox.Show(edit.EditValue.ToString());
     //memoEdit1.Text = cbART_Type.EditValue.ToString();
 }
Exemplo n.º 3
0
 public static void SetITLCheckedComboBoxEditStyle(CheckedComboBoxEdit chkcbb)
 {
     chkcbb.Properties.AllowFocused   = false; //不允许有焦点
     chkcbb.Properties.TextEditStyle  = TextEditStyles.DisableTextEditor;
     chkcbb.Properties.AutoHeight     = false;
     chkcbb.Properties.ItemAutoHeight = false;
 }
Exemplo n.º 4
0
        public static void DataBind(CheckedComboBoxEdit comboBox, IEnumerable dataSource,
                                    object selectedItemString, IsValidDataItemDelegate isValidCallback)
        {
            if (CollectionUtils.IsNullOrEmpty(dataSource))
            {
                comboBox.Properties.Items.Clear();
                return;
            }
            object selectedItem = null;

            comboBox.Properties.Items.BeginUpdate();
            comboBox.Properties.Items.Clear();
            try
            {
                string testString = (selectedItemString != null) ? selectedItemString.ToString() : null;
                foreach (object item in dataSource)
                {
                    bool isValidItem = (isValidCallback != null) ? isValidCallback(item) : true;
                    if (isValidItem)
                    {
                        comboBox.Properties.Items.Add(item);
                        if ((testString != null) &&
                            string.Equals(testString, item.ToString(), StringComparison.InvariantCultureIgnoreCase))
                        {
                            selectedItem = item;
                        }
                    }
                }
            }
            finally
            {
                comboBox.Properties.Items.EndUpdate();
            }
            comboBox.EditValue = selectedItem;
        }
Exemplo n.º 5
0
        public static void Ex_SetDataSource(this CheckedComboBoxEdit chkList, string table)
        {
            chkList.Properties.SeparatorChar = clsParameter.separatorChar;
            using (var context = new Models.QL_HOIVIEN_KTEntities())
            {
                chkList.Properties.Items.Clear();
                CategoryEntitiesTable tableEnum = table.Ex_ToEnum <CategoryEntitiesTable>();
                switch (tableEnum)
                {
                case CategoryEntitiesTable.DM_KHUYETTAT_TINHTRANG:
                    var listItem = (from p in context.DM_KHUYETTAT_TINHTRANG orderby p.TTKT_STT select p).ToArray();
                    foreach (DM_KHUYETTAT_TINHTRANG item in listItem)
                    {
                        chkList.Properties.Items.Add(item.TTKT_TEN, item.TTKT_TEN);
                    }
                    break;

                case CategoryEntitiesTable.DM_NHA_TAI_TRO:
                    var listItem2 = (from p in context.DM_NHA_TAI_TRO select p).ToArray();
                    foreach (DM_NHA_TAI_TRO item in listItem2)
                    {
                        chkList.Properties.Items.Add(item.NTT_TEN, item.NTT_TEN);
                    }
                    break;

                default:
                    break;
                }
            }
        }
Exemplo n.º 6
0
 public static void BindingCheckedComboBoxSource(CheckedComboBoxEdit edit, DataTable dataSource, string displayMember, string valueMember)
 {
     edit.Properties.DisplayMember = displayMember;
     edit.Properties.ValueMember   = valueMember;
     edit.Properties.DataSource    = null;
     edit.Properties.DataSource    = dataSource;
 }
 private void GetList_UEN_Checked(CheckedComboBoxEdit checkedComboBox_NhanVien, out List <int> List_UEN)
 {
     // lấy danh sách các mã nhân viên check
     List_UEN = (from CheckedListBoxItem item in checkedComboBox_NhanVien.Properties.Items
                 where item.CheckState == CheckState.Checked
                 select(int) item.Value).ToList();
 }
        public static void PopulateCheckedListBox <T, C>(CheckedComboBoxEdit checkedComboBoxEdit, T list, T selectedList)
            where T : ReadOnlyBindingListBase <T, C>, ILookupObjectList
            where C : ILookupObject
        {
            checkedComboBoxEdit.Properties.Items.BeginUpdate();

            checkedComboBoxEdit.Properties.Items.Clear();
            CheckedListBoxItem clb;
            string             editValue = string.Empty;

            foreach (C element in list)
            {
                clb = new CheckedListBoxItem(element);
                checkedComboBoxEdit.Properties.Items.Add(clb);
                string selected = CheckSelected <T, C>(clb, selectedList, element);
                if (!string.IsNullOrEmpty(selected))
                {
                    if (!string.IsNullOrEmpty(editValue))
                    {
                        editValue += ", ";
                    }
                    editValue += selected;
                }
            }
            checkedComboBoxEdit.EditValue = editValue;
            checkedComboBoxEdit.Properties.Items.EndUpdate();
        }
Exemplo n.º 9
0
        internal static void SetCheckedComboEdit(CheckedComboBoxEdit control, ICollection <string> list, bool includeALL = false, TextEditStyles style = TextEditStyles.Standard)
        {
            if (control == null)
            {
                return;
            }

            control.Properties.Items.Clear();

            if (includeALL)
            {
                control.Properties.Items.Add(ALL);
            }

            foreach (string item in list)
            {
                control.Properties.Items.Add(item);
            }

            if (control.Properties.Items.Count > 0)
            {
                foreach (CheckedListBoxItem item in control.Properties.Items)
                {
                    item.CheckState = CheckState.Checked;
                }
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// 创建勾选下拉框
        /// </summary>
        /// <param name="captain">标签</param>
        /// <param name="prop">属性</param>
        /// <param name="item_list">下拉列表</param>
        /// <param name="select_all_captain">选择所有项按钮的标签</param>
        /// <param name="separator_char">分隔符</param>
        /// <returns></returns>
        public LayoutControlItem CreateCheckedComboItem(string captain, string prop, List <string> item_list, string select_all_captain = "(Select All)", char separator_char = ',', bool is_readonly = false)
        {
            LayoutControlItem item = new LayoutControlItem();

            CheckedComboBoxEdit checkedComboBoxEdit = new CheckedComboBoxEdit();

            checkedComboBoxEdit.DataBindings.Add("EditValue", bindingSource, prop);
            checkedComboBoxEdit.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
                new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
            });
            foreach (string str in item_list)
            {
                checkedComboBoxEdit.Properties.Items.Add(str);
            }
            checkedComboBoxEdit.Properties.DropDownRows    = 20;
            checkedComboBoxEdit.Properties.ReadOnly        = is_readonly;
            checkedComboBoxEdit.Properties.NullValuePrompt = captain;
            checkedComboBoxEdit.Properties.NullValuePromptShowForEmptyValue = true;
            checkedComboBoxEdit.Properties.SelectAllItemCaption             = select_all_captain;
            checkedComboBoxEdit.Properties.SeparatorChar = separator_char;
            checkedComboBoxEdit.Properties.ShowNullValuePromptWhenFocused = true;

            item.Control = checkedComboBoxEdit;
            item.Text    = captain;

            return(item);
        }
Exemplo n.º 11
0
 /// <summary>
 /// 获取下拉列表的值
 /// </summary>
 /// <param name="combo">下拉列表</param>
 /// <returns></returns>
 public static string GetCheckedComboBoxValue(this CheckedComboBoxEdit combo)
 {
     if (combo.Properties.Items.Count <= 0)
     {
         return(string.Empty);
     }
     else
     {
         StringBuilder sb = new StringBuilder();
         for (Int32 i = 0; i < combo.Properties.Items.Count; i++)
         {
             if (combo.Properties.Items[i].CheckState == CheckState.Checked)
             {
                 sb.Append(combo.Properties.Items[i].Value + Const.Comma);
             }
         }
         if (sb.Length > 0)
         {
             return(sb.Remove(sb.Length - 1, 1).ToString());
         }
         else
         {
             return(sb.ToString());
         }
     }
 }
Exemplo n.º 12
0
        /// <summary>
        /// 绑定下拉列表控件为指定的数据字典列表
        /// </summary>
        /// <param name="combo">下拉列表控件</param>
        /// <param name="dictTypeId">数据字典值</param>
        public static void BindDictItems(this CheckedComboBoxEdit combo, Int32 dictTypeId, string defaultValue)
        {
            List <CheckedListBoxItem> dataSourcre = new List <CheckedListBoxItem>();

            var cacheDictData = Cache.Instance["DictData"] as List <DicKeyValueInfo>;

            if (cacheDictData != null)
            {
                return;
            }

            var lst = cacheDictData.FindAll(s => s.DictType_ID == dictTypeId);

            combo.Properties.BeginUpdate();//可以加快
            combo.Properties.Items.Clear();
            foreach (DicKeyValueInfo one in lst)
            {
                dataSourcre.Add(new CheckedListBoxItem()
                {
                    Value = one.Value, Description = one.Value + Const.Minus + one.Name
                });
            }
            combo.Properties.Items.AddRange(dataSourcre.ToArray());

            if (!string.IsNullOrEmpty(defaultValue))
            {
                combo.SetComboBoxItem(defaultValue);
            }

            combo.Properties.EndUpdate();//可以加快
        }
Exemplo n.º 13
0
        public static void QueryCheckCmbPOTypeList(eSolutionDataContext db, ref CheckedComboBoxEdit cmbName, Boolean argAll = false)
        {
            DataTable dt = DatabaseHelper.GetUserCodeData(db, "POTYPE", "COMMON", false);

            cmbName.Properties.Items.Clear();
            cmbName.Properties.DataSource = null;

            if (dt.Rows.Count > 0)
            {
                cmbName.Properties.DataSource = dt;
                cmbName.Properties.ValueMember = "ValueMember";
                cmbName.Properties.DisplayMember = "DisplayMember";
                cmbName.Properties.Items.Add("Value", CheckState.Unchecked, true);
                cmbName.CheckAll();
                cmbName.SetEditValue(0);
                cmbName.CheckAll();
            }
            else
            {
                cmbName.SetEditValue(null);
            }
            cmbName.Properties.PopupControl = null;
            cmbName.Properties.SeparatorChar = ';';
            cmbName.Properties.PopupResizeMode = DevExpress.XtraEditors.Controls.ResizeMode.LiveResize;

        }
Exemplo n.º 14
0
        private void SetInial(string strWinTitle, string strReportName)
        {
            this.Text     = strWinTitle;
            this.Rept_Key = strReportName;
            string strFilePath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "\\SysRpt\\" + strReportName + ".rdlc";

            if (!File.Exists(strFilePath))
            {
                throw new Exception("不存在报表文件:" + strReportName);
            }

            for (int i = gcQuery.Controls.Count - 1; i >= 0; i--)
            {
                Control ctrl = gcQuery.Controls[i];
                if (ctrl.Name != "btnOk")
                {
                    gcQuery.Controls.Remove(ctrl);
                }
            }
            int            igcHeight;
            List <Control> lisGcContrs = StaticFunctions.ShowGroupControl(gcQuery, iPosxBtn - 50, dtShow, strReportName, dtConst, true, 60, false, null, true, out igcHeight);

            foreach (Control ctrl in lisGcContrs)
            {
                switch (ctrl.GetType().ToString())
                {
                case "DevExpress.XtraEditors.SimpleButton":
                    break;

                case "DevExpress.XtraEditors.TextEdit":
                    break;

                case "DevExpress.XtraEditors.CheckEdit":
                    break;

                case "DevExpress.XtraEditors.LookUpEdit":
                    LookUpEdit dpl = ctrl as LookUpEdit;
                    dpl.Properties.QueryPopUp += new System.ComponentModel.CancelEventHandler(this.lookUpEdit_Properties_QueryPopUp);
                    dpl.Properties.Closed     += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.CheckedComboBoxEdit":
                    CheckedComboBoxEdit chkdpl = ctrl as CheckedComboBoxEdit;
                    chkdpl.Properties.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.DateEdit":
                    break;

                default:
                    break;
                }
            }

            reportViewer1.ProcessingMode          = Microsoft.Reporting.WinForms.ProcessingMode.Local;
            reportViewer1.LocalReport.DisplayName = strWinTitle;
            reportViewer1.LocalReport.ReportPath  = strFilePath;
        }
Exemplo n.º 15
0
        private void InitContr()
        {
            if (dsLoad != null)
            {
                return;
            }

            dsLoad = this.GetFrmLoadDs(this.Name);
            dsLoad.AcceptChanges();
            dtShow  = dsLoad.Tables[0];
            dtConst = dsLoad.Tables[1];

            GridViewEdit  = gridVMain;
            ParentControl = gcInfo;
            BtnEnterSave  = btnSave;

            int       igcHeight;
            Rectangle rect = SystemInformation.VirtualScreen;

            StaticFunctions.ShowGridControl(gridVMain, dtShow, dtConst);
            StaticFunctions.InitGridViewStyle(gvSet);

            #region gcInfo
            List <Control> lisGcContrs = StaticFunctions.ShowGcContrs(gcInfo, rect.Width - 50 - splitContainerControl1.SplitterPosition, dtShow, dtConst, true, 50, true, arrContrSeq, false
                                                                      , out blSetDefault, out strNoEnableCtrIds, out strFileds, out CtrFirstEditContr, out igcHeight);
            splitContainerControl2.SplitterPosition = (igcHeight > 100 ? igcHeight + 71 : 171);
            foreach (Control ctrl in lisGcContrs)
            {
                ctrl.Enter += new System.EventHandler(this.Txt_Enter);
                switch (ctrl.GetType().ToString())
                {
                case "DevExpress.XtraEditors.TextEdit":
                    break;

                case "DevExpress.XtraEditors.CheckEdit":
                    break;

                case "DevExpress.XtraEditors.LookUpEdit":
                    LookUpEdit dpl = ctrl as LookUpEdit;
                    dpl.Properties.QueryPopUp += new System.ComponentModel.CancelEventHandler(this.lookUpEdit_Properties_QueryPopUp);
                    dpl.Properties.Closed     += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.CheckedComboBoxEdit":
                    CheckedComboBoxEdit chkdpl = ctrl as CheckedComboBoxEdit;
                    chkdpl.Properties.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    arrcklis.Add(chkdpl);
                    break;

                case "DevExpress.XtraEditors.DateEdit":
                    break;

                default:
                    break;
                }
            }
            #endregion
        }
Exemplo n.º 16
0
        /// <summary>
        /// 绑定控件的字典数据
        /// </summary>
        public static DataTable BindDictItems(this CheckedComboBoxEdit control, DataTable dataSource, string displayMember, string valueMember)
        {
            control.Properties.DataSource    = dataSource;
            control.Properties.DisplayMember = displayMember;
            control.Properties.ValueMember   = valueMember;
            control.Properties.NullText      = string.Empty;

            return(dataSource);
        }
Exemplo n.º 17
0
 /// <summary>
 /// Khởi tạo dữ liệu cho ChecedComboBoxEdit
 /// </summary>
 /// <param name="ckb">CheckedComboBoxEdit càn khởi tạo</param>
 /// <param name="list">List<CheckedListBoxItem> danh sách các phần tử cần đưa vào</param>
 public static void InitCheckedComboBoxEdit(CheckedComboBoxEdit ckb, List <CheckedListBoxItem> list)
 {
     ckb.Properties.NullText             = "(Chưa chọn)";
     ckb.Properties.SelectAllItemCaption = "[Tất cả]";
     ckb.Properties.TextEditStyle        = TextEditStyles.Standard;
     ckb.Properties.Items.Clear();
     ckb.Properties.Items.AddRange(list.ToArray());
     ckb.Properties.SeparatorChar = ';';
     ckb.CheckAll();
 }
Exemplo n.º 18
0
        public static string GetWhereClause(CheckedComboBoxEdit checkedComboBoxEdit, string field)
        {
            var items = (from CheckedListBoxItem item in checkedComboBoxEdit.Properties.Items
                         where item.CheckState == CheckState.Checked
                         select item.Value).ToArray();

            return(items.Length == 1
                ? GetWhereClause(field, WhereOperator.Equals, true, items[0])
                : GetWhereClause(field, WhereOperator.In, true, items));
        }
Exemplo n.º 19
0
 public static void ClearSelection(CheckedComboBoxEdit checkedComboBoxEdit)
 {
     foreach (
         CheckedListBoxItem item in
         checkedComboBoxEdit.Properties.Items.Cast <CheckedListBoxItem>()
         .Where(item => item.CheckState == CheckState.Checked))
     {
         item.CheckState = CheckState.Unchecked;
     }
 }
Exemplo n.º 20
0
        protected override object CreateControlCore()
        {
            CheckedComboBoxEdit checkedEdit = new CheckedComboBoxEdit();

            if (TypeHasFlagsAttribute())
            {
                return(checkedEdit);
            }
            return(base.CreateControlCore());
        }
Exemplo n.º 21
0
 /// <summary>
 /// Recorre el los items del combo y chekea aquellos q pertenescan a items del paciente
 /// </summary>
 /// <param name="cmd"></param>
 void SetCombo(CheckedComboBoxEdit cmd)
 {
     foreach (CheckedListBoxItem item in cmd.Properties.Items)
     {
         if (_PatientAllergy.OtherAllergy.Contains(item.Value.ToString()))
         {
             item.CheckState = CheckState.Checked;
         }
     }
 }
Exemplo n.º 22
0
        /// <summary>
        /// Khởi tạo dữ liệu cho ChecedComboBoxEdit
        /// </summary>
        /// <param name="ckb">CheckedComboBoxEdit càn khởi tạo</param>
        /// <param name="checkMode">ChecState: check hay không</param>
        /// <param name="loai">LoaiDuLieu cần khởi tạo</param>
        public static void InitCheckedComboBoxEdit(CheckedComboBoxEdit ckb, CheckState checkMode, LoaiDuLieu loai, string ma_truong)
        {
            ckb.Properties.NullText             = "(Chưa chọn)";
            ckb.Properties.SelectAllItemCaption = "[Tất cả]";
            ckb.Properties.TextEditStyle        = TextEditStyles.Standard;
            ckb.Properties.Items.Clear();

            List <CheckedListBoxItem> _list = new List <CheckedListBoxItem>();

            switch (loai)
            {
            case LoaiDuLieu.Bac_LoaiHinh:
                VList <ViewBacDaoTaoLoaiHinh> _vListBacDaoTaoLoaiHinh = DataServices.ViewBacDaoTaoLoaiHinh.GetAll();
                _vListBacDaoTaoLoaiHinh.Sort("MaBacLoaiHinh");
                foreach (ViewBacDaoTaoLoaiHinh v in _vListBacDaoTaoLoaiHinh)
                {
                    _list.Add(new CheckedListBoxItem(v.MaBacLoaiHinh, v.TenBacLoaiHinh, checkMode, true));
                }
                break;

            case LoaiDuLieu.HocHam:
                TList <HocHam> _tListHocHam;
                _tListHocHam = DataServices.HocHam.GetAll();
                foreach (HocHam hh in _tListHocHam)
                {
                    _list.Add(new CheckedListBoxItem(hh.MaHocHam, hh.TenHocHam, checkMode, true));
                }
                break;

            case LoaiDuLieu.KhoaDonVi:
                VList <ViewKhoa> _vListKhoa;
                _vListKhoa = DataServices.ViewKhoa.GetAll();
                _vListKhoa.Sort("TenKhoa");
                foreach (ViewKhoa v in _vListKhoa)
                {
                    _list.Add(new CheckedListBoxItem(v.MaKhoa, v.TenKhoa, checkMode, true));
                }
                break;

            case LoaiDuLieu.NgachLuong:
                TList <NgachCongChuc> _tListNgachCongChuc;
                _tListNgachCongChuc = DataServices.NgachCongChuc.GetAll();
                foreach (NgachCongChuc ngach in _tListNgachCongChuc)
                {
                    _list.Add(new CheckedListBoxItem(ngach.MaQuanLy, ngach.TenNgach, checkMode, true));
                }
                break;

            default:
                return;
            }

            ckb.Properties.Items.AddRange(_list.ToArray());
            ckb.Properties.SeparatorChar = ';';
        }
Exemplo n.º 23
0
        public static uint[] GetCheckedValues(this CheckedComboBoxEdit box, object editvalue)
        {
            if (editvalue == null || string.IsNullOrWhiteSpace(editvalue.ToString()))
            {
                return(new uint[0]);
            }

            return(editvalue.ToString().Split(new char[1] {
                ','
            }, StringSplitOptions.RemoveEmptyEntries).Select(i => Convert.ToUInt32(i.Trim())).ToArray());
        }
Exemplo n.º 24
0
        protected override object CreateControlCore()
        {
            CheckedComboBoxEdit checkedEdit = new CheckedComboBoxEdit();

            checkedEdit.Properties.ForceUpdateEditValue = DevExpress.Utils.DefaultBoolean.True;
            if (TypeHasFlagsAttribute())
            {
                return(checkedEdit);
            }
            return(base.CreateControlCore());
        }
Exemplo n.º 25
0
 public static List<object> checkedCMBEGetData(CheckedComboBoxEdit checkedCMBE)
 {
     try
     {
         return checkedCMBE.Properties.Items.GetCheckedValues();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 26
0
        private void gridView2_ShownEditor(object sender, EventArgs e)
        {
            GridView view = (GridView)sender;

            if (view.ActiveEditor is CheckedComboBoxEdit)
            {
                CheckedComboBoxEdit editor = (CheckedComboBoxEdit)view.ActiveEditor;
                editor.EditValue = editor.Properties.Items[0].Value.ToString() + editor.Properties.SeparatorChar + editor.Properties.Items[2].Value.ToString();
                editor.Properties.Items[2].Enabled = false;
            }
        }
Exemplo n.º 27
0
 public void Init(IRaster raster, ComboBoxEdit cmbOutputType, ComboBoxEdit cmbPixelType, ComboBoxEdit cmbResamplingType, CheckedComboBoxEdit checkedCmbBand)
 {
     this.m_raster            = raster;
     this.m_cmbOutputType     = cmbOutputType;
     this.m_cmbPixelType      = cmbPixelType;
     this.m_cmbResamplingType = cmbResamplingType;
     this.m_checkedCmbBand    = checkedCmbBand;
     this.InitOutputType(cmbOutputType);
     this.InitResamplingMethod(cmbResamplingType);
     this.InitPixelType(cmbPixelType);
     this.InitOutputBands(checkedCmbBand);
 }
Exemplo n.º 28
0
        /// <summary>
        /// 绑定下拉列表控件为指定的数据字典列表
        /// </summary>
        /// <param name="control">下拉列表控件</param>
        /// <param name="dictTypeName">数据字典类型名称</param>
        public static void BindDictItems(this CheckedComboBoxEdit control, string dictTypeName, string defaultValue)
        {
            List <CListItem>            itemList = new List <CListItem>();
            Dictionary <string, string> dict     = BLLFactory <DictData> .Instance.GetDictByDictType(dictTypeName);

            foreach (string key in dict.Keys)
            {
                itemList.Add(new CListItem(key, dict[key]));
            }

            control.BindDictItems(itemList, defaultValue);
        }
 public static void BindingSource(this CheckedComboBoxEdit editControl, BindingSource bindingSource, string fieldName = "", string propertyName = "EditValue")
 {
     try
     {
         editControl.DataBindings.Clear();
         Binding b = new Binding(propertyName, bindingSource, string.IsNullOrEmpty(fieldName) ? editControl.Tag?.ToString() : fieldName, true);
         editControl.DataBindings.Add(b);
     }
     catch (Exception ex)
     {
         BSLog.Logger.Debug("Lỗi CheckedComboBoxEdit: " + ex.Message);
     }
 }
Exemplo n.º 30
0
        public static void SetComboList(CheckedComboBoxEdit combo, List <string> list, bool checkedALL = false)
        {
            combo.Properties.Items.Clear();

            foreach (string item in list)
            {
                //combo.Properties.Items.Add(item);
                combo.Properties.Items.Add(item, CheckState.Checked, checkedALL);
            }
            combo.Properties.SeparatorChar = ';';

            combo.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
        }
Exemplo n.º 31
0
        private int GetItemIndex(CheckedComboBoxEdit edit, string description)
        {
            CheckedListBoxItemCollection collection = edit.Properties.GetItems();

            for (int i = 0; i < collection.Count; i++)
            {
                if (collection[i].Description.Equals(description))
                {
                    return(i);
                }
            }
            return(-1);
        }
        public static List<Guid> getCheckedValueArray(CheckedComboBoxEdit control)
        {
            List<Guid> re = new List<Guid>();
            if (control == null)
            {
                return re;
            }

            for (int i = 0; i < control.Properties.Items.Count; i++)
            {
                if (control.Properties.Items[i].CheckState == CheckState.Checked)
                {
                    re.Add(GUID.From(control.Properties.Items[i].Value));
                }
            }

            return re;
        }
Exemplo n.º 33
0
 private CheckedComboBoxEdit CreateLookupedit(int LookupID)
 {
     List<object> data = DataManager.ExeDSLookup(LookupID);
     CheckedComboBoxEdit ccbe = new CheckedComboBoxEdit();
     ccbe.Properties.AllowMultiSelect = true;
     ccbe.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.False;
     ccbe.Properties.DataSource = Classes.Managers.UserManager.defaultInstance.LookupUserValue((DataTable)data[0], data[2].ToString(), LookupID);
     ccbe.Properties.DisplayMember = data[1].ToString();
     ccbe.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
     ccbe.Properties.ValueMember = data[2].ToString();
     ccbe.EditValueChanged += new EventHandler((e, o) =>
     { ((CheckedComboBoxEdit)e).RefreshEditValue(); });//validate edit value to do not select out of list items
     return ccbe;
 }
Exemplo n.º 34
0
 /// <summary>
 /// Recorre el los items del combo y chekea aquellos q pertenescan a items del paciente
 /// </summary>
 /// <param name="cmd"></param>
 void SetCombo(CheckedComboBoxEdit cmd)
 {
     foreach (CheckedListBoxItem item in cmd.Properties.Items)
     {
         if (_PatientAllergy.OtherAllergy.Contains(item.Value.ToString()))
             item.CheckState = CheckState.Checked;
     }
 }
        private CheckedComboBoxEdit CreateLookupeditForMaterial()
        {
            NICSQLTools.Data.Linq.dsLinqDataDataContext ds = new NICSQLTools.Data.Linq.dsLinqDataDataContext();
            DevExpress.Data.Linq.LinqServerModeSource lsms = new DevExpress.Data.Linq.LinqServerModeSource();
            lsms.ElementType = typeof(NICSQLTools.Data.Linq.vAppProductDetail); lsms.KeyExpression = "[Material_Number]";
            lsms.QueryableSource = from q in ds.vAppProductDetails select q;

            CheckedComboBoxEdit ccbe = new CheckedComboBoxEdit();
            ccbe.Properties.AllowMultiSelect = true;
            ccbe.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.False;
            ccbe.Properties.DataSource = lsms;
            ccbe.Properties.DisplayMember = "Material_Number";
            ccbe.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            ccbe.Properties.ValueMember = "Material_Number";

            return ccbe;
        }
Exemplo n.º 36
0
 /// <summary>
 /// Create control
 /// </summary>
 /// <returns></returns>
 protected override object CreateControlCore() {
     comboControl = new CheckedComboBoxEdit();
     return comboControl;
 }
 /// <summary>
 /// Create control
 /// </summary>
 /// <returns></returns>
 protected override object CreateControlCore() {
     _comboControl = new CheckedComboBoxEdit();
     _comboControl.Properties.IncrementalSearch = true;
     return _comboControl;
 }
        private CheckedComboBoxEdit CreateLookupeditForSalesDistrict2()
        {
            NICSQLTools.Data.dsQryTableAdapters.SalesDistrict2TableAdapter adp = new NICSQLTools.Data.dsQryTableAdapters.SalesDistrict2TableAdapter();
            CheckedComboBoxEdit ccbe = new CheckedComboBoxEdit();
            ccbe.Name = "ccbe";
            ccbe.Properties.AllowMultiSelect = true;
            ccbe.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.False;
            ccbe.Properties.DataSource = Classes.Managers.UserManager.defaultInstance.UserRuleSalesDistrictTable;
            ccbe.Properties.DisplayMember = "Sales District 2";
            ccbe.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            ccbe.Properties.ValueMember = "Sales District 2";
            //ccbe.Size = new Size(100, 20);
            //ccbe.TabIndex = 2;

            return ccbe;
        }