private RepositoryItemImageComboBox GetEnumRepository(Type x)
        {
            var repo = new RepositoryItemImageComboBox();

            repo.Items.AddEnum(x);
            return(repo);
        }
예제 #2
0
 public BuildingBlockMergeView(IImageListRetriever imageListRetriever)
 {
     InitializeComponent();
     _gridViewBinder = new GridViewBinder <BuildingBlockMappingDTO>(gridView);
     _repositoryForProjectBuildingBlock = new UxRepositoryItemImageComboBox(gridView, imageListRetriever);
     gridView.AllowsFiltering           = false;
 }
예제 #3
0
        public void PopulateSpawnItemTypes(RepositoryItemImageComboBox cmb, bool isAddEmpty, bool isSmallImages)
        {
            var spawnItemTypes = cmb.Items;

            cmb.DropDownRows = MaxDropDownRows;
            spawnItemTypes.Clear();

            ImageList ilImages = isSmallImages ? ilSpawnItemTypesSmall : ilSpawnItemTypesLarge;

            cmb.SmallImages        = ilImages;
            cmb.Buttons[0].Visible = false;
            cmb.GlyphAlignment     = HorzAlignment.Center;
            try
            {
                if (isAddEmpty)
                {
                    spawnItemTypes.Add(null);
                }

                foreach (KeyValuePair <string, string> itemType in Pack.SpawnItemConfig.Types)
                {
                    string imgFileName = itemType.Value;
                    string type        = itemType.Key;
                    int    imgIndex    = GetImageIndex(ilImages, imgFileName, true);

                    spawnItemTypes.Add(new ImageComboBoxItem(type, type, imgIndex));
                }
            }
            catch (Exception ex)
            {
                ((ILog)this).Write("Error while populating spawn item types combo: {0}", ex.Message);
            }
        }
예제 #4
0
        private void CreatedGridControlSource()
        {
            BindingList <Test> source = new BindingList <Test>();

            source.Add(new Test()
            {
                Style = HatchStyle.DarkDownwardDiagonal, CustomColor = Color.Red
            });
            source.Add(new Test()
            {
                Style = HatchStyle.DarkVertical, CustomColor = Color.Yellow
            });
            source.Add(new Test()
            {
                Style = HatchStyle.Percent10, CustomColor = Color.Brown
            });
            source.Add(new Test()
            {
                Style = HatchStyle.Trellis, CustomColor = Color.White
            });

            gridControl1.DataSource = source;
            gridControl1.ForceInitialize();

            RepositoryItemImageComboBox reHS = gridControl1.RepositoryItems.Add("ImageComboBoxEdit") as RepositoryItemImageComboBox;

            reHS.Assign(imageComboBoxEdit1.Properties);
            gridView1.Columns["Style"].ColumnEdit = reHS;


            RepositoryItemImageComboBox reColors = gridControl1.RepositoryItems.Add("ImageComboBoxEdit") as RepositoryItemImageComboBox;

            reColors.Assign(imageComboBoxEdit2.Properties);
            gridView1.Columns["CustomColor"].ColumnEdit = reColors;
        }
예제 #5
0
파일: Helpers.cs 프로젝트: shine8319/DLS
        public static void InitTitleComboBox(RepositoryItemImageComboBox edit)
        {
            //ImageCollection iCollection = new ImageCollection();
            //iCollection.AddImage(Properties.Resources.Doctor);
            //iCollection.AddImage(Properties.Resources.Miss);
            //iCollection.AddImage(Properties.Resources.Mr);
            //iCollection.AddImage(Properties.Resources.Mrs);
            //iCollection.AddImage(Properties.Resources.Ms);
            //iCollection.AddImage(Properties.Resources.Professor);
            //edit.Items.Add(new ImageComboBoxItem(string.Empty, ContactTitle.None, -1));
            //edit.Items.Add(new ImageComboBoxItem(GetTitleNameByContactTitle(ContactTitle.Dr), ContactTitle.Dr, 0));
            //edit.Items.Add(new ImageComboBoxItem(GetTitleNameByContactTitle(ContactTitle.Miss), ContactTitle.Miss, 1));
            //edit.Items.Add(new ImageComboBoxItem(GetTitleNameByContactTitle(ContactTitle.Mr), ContactTitle.Mr, 2));
            //edit.Items.Add(new ImageComboBoxItem(GetTitleNameByContactTitle(ContactTitle.Mrs), ContactTitle.Mrs, 3));
            //edit.Items.Add(new ImageComboBoxItem(GetTitleNameByContactTitle(ContactTitle.Ms), ContactTitle.Ms, 4));
            //edit.Items.Add(new ImageComboBoxItem(GetTitleNameByContactTitle(ContactTitle.Prof), ContactTitle.Prof, 5));
            //edit.SmallImages = iCollection;
            ImageCollection iCollection = new ImageCollection();

            //edit.Items.Add(new ImageComboBoxItem(string.Empty, UserLevel.None, -1));
            edit.Items.Add(new ImageComboBoxItem(GetLevelByUserLevel(UserLevel.Level1), UserLevel.Level1, 0));
            edit.Items.Add(new ImageComboBoxItem(GetLevelByUserLevel(UserLevel.Level2), UserLevel.Level2, 1));
            edit.Items.Add(new ImageComboBoxItem(GetLevelByUserLevel(UserLevel.Level3), UserLevel.Level3, 2));

            edit.SmallImages = iCollection;
        }
예제 #6
0
        /// <summary>
        /// 绑定ComboBox数据项
        /// </summary>
        /// <param name="cmb"></param>
        /// <param name="source"></param>
        /// <param name="displayField"></param>
        /// <param name="valueField"></param>
        public static void BindImageComboBox <T>(RepositoryItemImageComboBox cmb, IEnumerable <T> source, Func <T, bool> filterExpression, string displayField, string valueField)
        {
            if (source == null || !source.Any() || cmb == null || string.IsNullOrWhiteSpace(displayField) ||
                string.IsNullOrWhiteSpace(valueField))
            {
                cmb?.Items.Clear();
                return;
            }

            cmb.Items.Clear();

            IEnumerable <T> rows = source.Where(filterExpression);

            Type         type             = typeof(T);
            PropertyInfo valuefieldInfo   = type.GetProperty(valueField, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
            PropertyInfo displayfieldInfo = type.GetProperty(displayField, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);

            foreach (T row in rows)
            {
                ImageComboBoxItem itemtemp1 = new ImageComboBoxItem();

                itemtemp1.Value       = valuefieldInfo?.GetValue(row, null);
                itemtemp1.Description = displayfieldInfo?.GetValue(row, null)?.ToString();
                cmb.Items.Add(itemtemp1);
            }
        }
예제 #7
0
        public void ShowTableViewWithDatatableEnumType()
        {
            //demonstrates how hard it is to add custom editor to tableview for datatable
            //In this case you need
            //a typeconverter and comboboxhelper :(
            //TODO: look into the differences and abstract away from it
            var dataTable = new DataTable();

            dataTable.Columns.Add("Code", typeof(string));
            dataTable.Columns.Add("SomeEnum", typeof(FruitType));

            for (int i = 0; i < 10; i++)
            {
                dataTable.Rows.Add(new object[] { String.Format("Item{0:000}", i), FruitType.Appel });
            }

            dataTable.AcceptChanges();

            var tableView = new TableView {
                Data = dataTable
            };

            var comboBox = new RepositoryItemImageComboBox();

            XtraGridComboBoxHelper.Populate(comboBox, typeof(FruitType));

            tableView.SetColumnEditor(comboBox, 1);
            WindowsFormsTestHelper.ShowModal(tableView);
        }
        private void InitPersonFilter(string groupName, RibbonPageGroup ribbonGroup)
        {
            if (!_isManager)
            {
                return;
            }
            BarEditItem recordPersonDrop = new BarEditItem();

            recordPersonDrop.Width             = 100;
            recordPersonDrop.Caption           = Properties.Resources.RecordPerson;
            recordPersonDrop.CaptionAlignment  = DevExpress.Utils.HorzAlignment.Near;
            recordPersonDrop.EditValueChanged += (sender, e) =>
            {
                _filterrecordPerson = recordPersonDrop.EditValue.ToString();
                FilterTaskList();
            };
            RepositoryItemImageComboBox recordPersonItems = new RepositoryItemImageComboBox();
            var recordPersonList = _projectTaskList.Select(c => c.RecordPerson).Distinct <string>();

            recordPersonItems.Items.Add(new ImageComboBoxItem(Properties.Resources.None, string.Empty, -1));
            foreach (var recordPerson in recordPersonList)
            {
                recordPersonItems.Items.Add(new ImageComboBoxItem(recordPerson, recordPerson, -1));
            }
            recordPersonDrop.Edit = recordPersonItems;
            ribbonGroup.ItemLinks.Add(recordPersonDrop, true);
            FilterTaskList();
        }
예제 #9
0
        public static RepositoryItemImageComboBox GetLogTypesCombo()
        {
            var imgscol = GetLogImageCollection();
            var combo   = new RepositoryItemImageComboBox()
            {
                SmallImages = imgscol
            };

            combo.Items.Add(new DevExpress.XtraEditors.Controls.ImageComboBoxItem()
            {
                Value       = Core.Model.LogLineTypeEnum.Info,
                Description = Core.Model.LogLineTypeEnum.Info.ToString(),
                ImageIndex  = 0
            });
            combo.Items.Add(new DevExpress.XtraEditors.Controls.ImageComboBoxItem()
            {
                Value       = Core.Model.LogLineTypeEnum.ReadingFolder,
                Description = Core.Model.LogLineTypeEnum.ReadingFolder.ToString(),
                ImageIndex  = 1
            });
            combo.Items.Add(new DevExpress.XtraEditors.Controls.ImageComboBoxItem()
            {
                Value       = Core.Model.LogLineTypeEnum.Error,
                Description = Core.Model.LogLineTypeEnum.Error.ToString(),
                ImageIndex  = 2
            });
            return(combo);
        }
예제 #10
0
 private void InitImageComboBox(RepositoryItemImageComboBox item)
 {
     item.Items.AddEnum(typeof(TransactionType));
     for (int i = 0; i < item.Items.Count; i++)
     {
         item.Items[i].ImageIndex = i;
     }
 }
예제 #11
0
 public static RepositoryItemImageComboBox CreateTaskCategoryImageComboBox(RepositoryItemImageComboBox edit)
 {
     edit.Items.Clear();
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.TaskCategoryHouseChores, TaskCategory.HouseChores, 0));
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.TaskCategoryShopping, TaskCategory.Shopping, 1));
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.TaskCategoryOffice, TaskCategory.Office, 2));
     return(edit);
 }
예제 #12
0
        public ListViewControl(SchedulerControl scheduler)
        {
            InitializeComponent();
            OwnerScheduler = scheduler;

            appointmentImages = DevExpress.Utils.Controls.ImageHelper.CreateImageCollectionFromResources("ListViewComponent.Resources.AppointmentImages.png", System.Reflection.Assembly.GetExecutingAssembly(), new Size(15, 15));
            reStatus          = GridControlAppointments.RepositoryItems.Add("ImageComboBoxEdit") as RepositoryItemImageComboBox;
            gridViewAppointments.Columns["ListViewStatus"].ColumnEdit = reStatus;
        }
예제 #13
0
 public static void InitPriorityComboBox(RepositoryItemImageComboBox edit)
 {
     edit.Items.Clear();
     edit.Items.AddRange(new DevExpress.XtraEditors.Controls.ImageComboBoxItem[] {
         new DevExpress.XtraEditors.Controls.ImageComboBoxItem(Properties.Resources.PriorityLow, 0, 0),
         new DevExpress.XtraEditors.Controls.ImageComboBoxItem(Properties.Resources.PriorityMedium, 1, -1),
         new DevExpress.XtraEditors.Controls.ImageComboBoxItem(Properties.Resources.PriorityHigh, 2, 1)
     });
 }
예제 #14
0
        public static void InitPersonComboBox(RepositoryItemImageComboBox edit)
        {
            SvgImageCollection iCollection = new SvgImageCollection();

            iCollection.Add(Properties.Resources.Mr1);
            iCollection.Add(Properties.Resources.Ms1);
            edit.Items.Add(new ImageComboBoxItem(Properties.Resources.Male, ContactGender.Male, 0));
            edit.Items.Add(new ImageComboBoxItem(Properties.Resources.Female, ContactGender.Female, 1));
            edit.SmallImages = iCollection;
        }
예제 #15
0
        private void InitNotificationState()
        {
            if (!(_listView.ObjectGridView is GridView))
            {
                return;
            }
            GridView gridView = (GridView)_listView.ObjectGridView;
            var      listView = (Katrin.Win.ListViewModule.ListViews.ListView)_listView;

            listView.Load += (sender, e) =>
            {
                ImageList columnImageList = new ImageList();
                columnImageList.Images.Add(WinFormsResourceService.GetBitmap("readcol"));
                columnImageList.Images.Add(WinFormsResourceService.GetBitmap("readcol"));
                columnImageList.Images.SetKeyName(0, "");
                columnImageList.Images.SetKeyName(1, "");
                gridView.Images             = columnImageList;
                listView.DoubleClickCommand = null;
                foreach (GridColumn column in gridView.Columns)
                {
                    if (column.FieldName == "NotificationStatus")
                    {
                        RepositoryItemImageComboBox imgCombox = new RepositoryItemImageComboBox();
                        ImageList imageList = new ImageList();
                        imageList.Images.Add(WinFormsResourceService.GetBitmap("notificationreaded"));
                        imageList.Images.Add(WinFormsResourceService.GetBitmap("notification"));
                        imageList.Images.SetKeyName(0, "");
                        imageList.Images.SetKeyName(1, "");
                        imgCombox.SmallImages = imageList;
                        ImageComboBoxItem boxItem = new ImageComboBoxItem();
                        boxItem.Value      = 0;
                        boxItem.ImageIndex = 0;
                        imgCombox.Items.Add(boxItem);
                        ImageComboBoxItem boxItem2 = new ImageComboBoxItem();
                        boxItem2.Value      = 1;
                        boxItem2.ImageIndex = 1;
                        imgCombox.Items.Add(boxItem2);
                        column.ColumnEdit = imgCombox;
                    }
                    else if (column.FieldName == "CreatedOn")
                    {
                        column.DisplayFormat.FormatType   = FormatType.DateTime;
                        column.DisplayFormat.FormatString = "yyyy/M/d (dddd) HH:mm";
                    }
                }
                gridView.OptionsBehavior.AutoExpandAllGroups = true;

                Thread tread = new Thread(LoadData);
                tread.Start();
            };

            gridView.DoubleClick += gridView_DoubleClick;
            AuthorizationManager.NotificationList.DataSourceChanged -= NotificationList_DataSourceChanged;
            AuthorizationManager.NotificationList.DataSourceChanged += NotificationList_DataSourceChanged;
        }
        public void SetData(DataTable mapping, DataTable containerTable, ICollection tissueLov)
        {
            grdMappping.DataSource = mapping;
            var view = grdMappping.MainView as GridView;

            if (view == null)
            {
                return;
            }
            GridColumn col;

            col         = view.Columns[DatabaseConfiguration.MappingColumns.COL_CONTAINER];
            col.Caption = PKSimConstants.ProteinExpressions.ColumnCaptions.Mapping.COL_CONTAINER;
            col.OptionsFilter.FilterPopupMode = FilterPopupMode.CheckedList;
            var containerComboBoxEditor = new RepositoryItemImageComboBox();
            var smallImages             = new ImageCollection();

            containerComboBoxEditor.SmallImages    = smallImages;
            containerComboBoxEditor.AllowNullInput = DefaultBoolean.True;
            containerComboBoxEditor.KeyDown       += onContainerComboBoxEditorKeyDown;

            containerComboBoxEditor.Items.BeginUpdate();
            foreach (DataRow row in containerTable.Rows)
            {
                var             container   = (string)row[ColumnNamesOfTransferTable.Container.ToString()];
                var             displayName = (string)row[ColumnNamesOfTransferTable.DisplayName.ToString()];
                ApplicationIcon icon        = ApplicationIcons.IconByName(container);
                if (icon != null && icon != ApplicationIcons.EmptyIcon)
                {
                    smallImages.AddImage(icon.ToImage(), container);
                    containerComboBoxEditor.Items.Add(new ImageComboBoxItem(displayName, container, smallImages.Images.Count - 1));
                }
                else if (container.Length > 0)
                {
                    containerComboBoxEditor.Items.Add(new ImageComboBoxItem(displayName, container));
                }
            }

            containerComboBoxEditor.Items.EndUpdate();
            col.ColumnEdit = containerComboBoxEditor;

            col         = view.Columns[DatabaseConfiguration.MappingColumns.COL_TISSUE];
            col.Caption = PKSimConstants.ProteinExpressions.ColumnCaptions.Mapping.COL_TISSUE;
            col.OptionsFilter.FilterPopupMode = FilterPopupMode.CheckedList;
            var tissueComboBoxEditor = new UxRepositoryItemComboBox(view);

            tissueComboBoxEditor.AutoComplete   = true;
            tissueComboBoxEditor.AllowNullInput = DefaultBoolean.True;
            tissueComboBoxEditor.KeyDown       += onTissueComboBoxEditorKeyDown;
            tissueComboBoxEditor.TextEditStyle  = TextEditStyles.DisableTextEditor;
            tissueComboBoxEditor.Items.BeginUpdate();
            tissueComboBoxEditor.Items.AddRange(tissueLov);
            tissueComboBoxEditor.Items.EndUpdate();
            col.ColumnEdit = tissueComboBoxEditor;
        }
예제 #17
0
        /// <summary>
        /// 创建GridView的列编辑为ImageComboBox
        /// </summary>
        /// <param name="gridColumn">GridColumn列对象</param>
        /// <returns></returns>
        public static RepositoryItemImageComboBox CreateImageComboBox(this GridColumn gridColumn)
        {
            RepositoryItemImageComboBox repositoryItem = new RepositoryItemImageComboBox
            {
                AutoHeight = false
            };

            gridColumn.View.GridControl.RepositoryItems.Add(repositoryItem);
            gridColumn.ColumnEdit = repositoryItem;
            return(repositoryItem);
        }
예제 #18
0
        public override void CustomizeServerGridColumns(GridView view)
        {
            var colDescription = view.Columns["ServerInfo.Description"];
            var idx            = colDescription.VisibleIndex;

            colDescription.Visible = false;
            AddColumn(view, "g_factoryTitle", "Factory", "g_factoryTitle", 100, idx)
            .OptionsFilter.AutoFilterCondition = AutoFilterCondition.Default;

            AddColumn(view, "_gametype", "GT", "Gametype", 40, idx)
            .OptionsFilter.AutoFilterCondition = AutoFilterCondition.Default;

            idx           = view.Columns["PlayerCount"].VisibleIndex;
            this.colSkill = AddColumn(view, "_skill", "Skill", SkillTooltip, 60, ++idx, UnboundColumnType.Integer);
            AddColumn(view, "_score", "Score", "Current score", 50, ++idx, UnboundColumnType.Integer);
            //AddColumn(view, "_time", "Time", "Match time", 30, ++idx, UnboundColumnType.Integer);
            AddColumn(view, "_teamsize", "TS", "Team Size", 30, ++idx, UnboundColumnType.Integer);

            idx = view.Columns["ServerInfo.Ping"].VisibleIndex;
            AddColumn(view, "_goalscore", "SL", "Score Limit", 30, idx, UnboundColumnType.Integer);
            AddColumn(view, "timelimit", "TL", "Time Limit", 30, ++idx, UnboundColumnType.Integer);
            //AddColumn(view, "g_instaGib", "Insta", "Instagib", 35, ++idx, UnboundColumnType.Boolean);

            var col = AddColumn(view, "g_loadout", "Lo", "Loadout", 20, ++idx, UnboundColumnType.Boolean);
            var ed  = view.GridControl.RepositoryItems["riLoadout"] as RepositoryItemImageComboBox;

            if (ed == null)
            {
                ed = new RepositoryItemImageComboBox();
                ed.BeginInit();
                ed.Name        = "riLoadout";
                ed.SmallImages = view.Images;
                ed.Items.Add(new ImageComboBoxItem("No Loadouts", false, -1));
                ed.Items.Add(new ImageComboBoxItem("Loadouts", true, 28));
                ed.EndInit();
                view.GridControl.RepositoryItems.Add(ed);
            }
            col.ColumnEdit = ed;

            col = AddColumn(view, "g_itemTimers", "Ti", "Item Timers", 20, ++idx, UnboundColumnType.Boolean);
            ed  = view.GridControl.RepositoryItems["riItemTimer"] as RepositoryItemImageComboBox;
            if (ed == null)
            {
                ed = new RepositoryItemImageComboBox();
                ed.BeginInit();
                ed.Name        = "riItemTimer";
                ed.SmallImages = view.Images;
                ed.Items.Add(new ImageComboBoxItem("No Item Timers", false, -1));
                ed.Items.Add(new ImageComboBoxItem("Item Timers", true, 26));
                ed.EndInit();
                view.GridControl.RepositoryItems.Add(ed);
            }
            col.ColumnEdit = ed;
        }
예제 #19
0
        public static RepositoryItemImageComboBox CreateTreeImageComboBox(this TreeListColumn treeColumn)
        {
            RepositoryItemImageComboBox repositoryItem = new RepositoryItemImageComboBox
            {
                AutoHeight = false
            };

            treeColumn.TreeList.RepositoryItems.Add(repositoryItem);
            treeColumn.ColumnEdit = repositoryItem;
            return(repositoryItem);
        }
예제 #20
0
 /// <summary>
 /// 绑定枚举到ComboBox
 /// </summary>
 /// <param name="cmb">控件</param>
 /// <param name="type">枚举类型</param>
 public static void BindEnumToComboBox(RepositoryItemImageComboBox cmb, Type type)
 {
     foreach (Enum item in Enum.GetValues(type))
     {
         cmb.Items.Add(new ImageComboBoxItem
         {
             Description = item.DisplayName(),
             Value       = Convert.ToInt32(item)
         });
     }
 }
예제 #21
0
        public static RepositoryItemImageComboBox CreateShipmentStatusImageComboBox(ISkinProvider provider, RepositoryItemImageComboBox edit = null, RepositoryItemCollection collection = null)
        {
            RepositoryItemImageComboBox ret = CreateEnumImageComboBox <ShipmentStatus>(edit, collection);

            ret.SmallImages = CreateShipmentStatusImageCollection(provider);
            if (edit == null)
            {
                ret.GlyphAlignment = HorzAlignment.Center;
            }
            return(ret);
        }
예제 #22
0
 /// <summary>
 /// 绑定数据集到GridControl控件中的RepositoryItemImageComboBox列
 /// </summary>
 /// <param name="cmb">RepositoryItemImageComboBox控件</param>
 /// <param name="dt"></param>
 /// <param name="description"></param>
 /// <param name="value"></param>
 public static void BindImageComboBoxEdit(RepositoryItemImageComboBox cmb, DataTable dt, string description, string value)
 {
     cmb.Items.Clear();
     foreach (DataRow dr in dt.Rows)
     {
         ImageComboBoxItem item = new ImageComboBoxItem();
         item.Description = dr[description].ToString();
         item.Value       = Convert.ToDecimal(dr[value]);
         cmb.Items.Add(item);
     }
 }
예제 #23
0
        public static RepositoryItemImageComboBox CreatePersonPrefixImageComboBox(RepositoryItemImageComboBox edit = null, RepositoryItemCollection collection = null)
        {
            RepositoryItemImageComboBox ret = CreateEnumImageComboBox <PersonPrefix>(edit, collection);

            ret.SmallImages = CreatePersonPrefixImageCollection();
            if (edit == null)
            {
                ret.GlyphAlignment = HorzAlignment.Center;
            }
            return(ret);
        }
예제 #24
0
        public static RepositoryItemImageComboBox CreateTaskStatusImageComboBox(RepositoryItemImageComboBox edit)
        {
            Array arr = Enum.GetValues(typeof(TaskStatus));

            edit.Items.Clear();
            foreach (TaskStatus status in arr)
            {
                edit.Items.Add(new ImageComboBoxItem(GetStringByTaskStatus(status), status, (int)status));
            }
            return(edit);
        }
            protected RepositoryItem CreateRepositoryItemImageComboBox(string[] names, int valuesShift)
            {
                RepositoryItemImageComboBox item = new RepositoryItemImageComboBox();

                object[] values = CreateValues(valuesShift, names.Length);
                for (int i = 0; i < values.Length && i < names.Length; i++)
                {
                    item.Items.Add(new ImageComboBoxItem(names[i], values[i]));
                }
                return(item);
            }
예제 #26
0
        public static RepositoryItemImageComboBox CreateTaskPriorityImageComboBox(RepositoryItemImageComboBox edit = null, RepositoryItemCollection collection = null)
        {
            RepositoryItemImageComboBox ret = CreateEnumImageComboBox <EmployeeTaskPriority>(edit, collection);

            ret.SmallImages = CreateTaskPriorityImageCollection();
            if (edit == null)
            {
                ret.GlyphAlignment = HorzAlignment.Center;
            }
            return(ret);
        }
예제 #27
0
        public void RefreshProd(string orderno, long groupno)
        {
            Result res = new Result();

            gridControl2.DataSource = null;
            res = _core.RemoteObject.Connection.Call(_core.RemoteObject.User.UserNo, 210, 130116, 130116, new object[] { orderno, groupno });
            if (res.ResultNo == 0)
            {
                RepositoryItemImageComboBox imagecombo = new RepositoryItemImageComboBox();
                imagecombo.GlyphAlignment = DevExpress.Utils.HorzAlignment.Center;
                ImageComboBoxItem imageitem = new ImageComboBoxItem();
                ImageCollection   imgcol    = new ImageCollection();
                imgcol.AddImage(_core.Resource.GetImage("alarmclock"));
                imagecombo.Properties.SmallImages = imgcol;
                imageitem.Value      = Static.ToDecimal(1);
                imageitem.ImageIndex = 0;
                imagecombo.Properties.Items.Add(imageitem);
                ISM.Template.FormUtility.GridLayoutGet(gridView2, res.Data.Tables[0], _layoutfilename);
                gridView2.Appearance.Row.Font   = new Font("Tahoma", 10.0F);
                gridView2.Columns[0].Caption    = "Захиалгын дугаар";
                gridView2.Columns[0].Visible    = false;
                gridView2.Columns[1].Caption    = "Багцын дугаар";
                gridView2.Columns[1].Visible    = false;
                gridView2.Columns[2].Caption    = "Бүтээгдэхүүний дугаар";
                gridView2.Columns[2].Visible    = false;
                gridView2.Columns[3].Caption    = "Бүтээгдэхүүний төрлийн дугаар";
                gridView2.Columns[3].Visible    = false;
                gridView2.Columns[4].Caption    = "Бүтээгдэхүүний төрөл";
                gridView2.Columns[5].Caption    = "Тоо ширхэг";
                gridView2.Columns[6].Caption    = "Хуваарьтай эсэх";
                gridView2.Columns[6].ColumnEdit = imagecombo;
                gridView2.Columns[10].Caption   = "Бүтээгдэхүүний нэр";
                gridView2.Columns[7].Visible    = false;
                gridView2.Columns[8].Visible    = false;
                gridView2.Columns[9].Visible    = false;

                gridView2.Columns[0].OptionsColumn.AllowEdit  = false;
                gridView2.Columns[1].OptionsColumn.AllowEdit  = false;
                gridView2.Columns[2].OptionsColumn.AllowEdit  = false;
                gridView2.Columns[3].OptionsColumn.AllowEdit  = false;
                gridView2.Columns[4].OptionsColumn.AllowEdit  = false;
                gridView2.Columns[5].OptionsColumn.AllowEdit  = false;
                gridView2.Columns[6].OptionsColumn.AllowEdit  = false;
                gridView2.Columns[7].OptionsColumn.AllowEdit  = false;
                gridView2.Columns[8].OptionsColumn.AllowEdit  = false;
                gridView2.Columns[9].OptionsColumn.AllowEdit  = false;
                gridView2.Columns[10].OptionsColumn.AllowEdit = false;
            }
            else
            {
                MessageBox.Show(res.ResultNo + " : " + res.ResultDesc);
            }
        }
예제 #28
0
        /// <summary>
        /// 班组id翻译成描述
        /// </summary>
        /// <returns></returns>
        public RepositoryItemImageComboBox GetBZIdDescItemComboBox()
        {
            var dt   = bll_TB_BCBZ.GetNCBZList("", "").Tables[0];
            var repo = new RepositoryItemImageComboBox();

            foreach (DataRow item in dt.Rows)
            {
                var list = new ImageComboBoxItem(item["BZMC"].ToString(), item["PK_PGAID"]);
                repo.Items.Add(list);
            }
            return(repo);
        }
예제 #29
0
        /// <summary>
        /// 工位id翻译成描述
        /// </summary>
        /// <returns></returns>
        public RepositoryItemImageComboBox GetGWIdDescItemComboBox()
        {
            var dt   = bll_TB_STA.GetAllList().Tables[0];
            var repo = new RepositoryItemImageComboBox();

            foreach (DataRow item in dt.Rows)
            {
                var list = new ImageComboBoxItem(item["C_STA_DESC"].ToString(), item["C_ID"]);
                repo.Items.Add(list);
            }
            return(repo);
        }
예제 #30
0
        /// <summary>
        /// 方案id翻译成描述
        /// </summary>
        /// <returns></returns>
        public RepositoryItemImageComboBox GetFADescItemComboBox()
        {
            var dt   = bll_TPP_INITIALIZE_ITEM.GetAllList().Tables[0];
            var repo = new RepositoryItemImageComboBox();

            foreach (DataRow item in dt.Rows)
            {
                var list = new ImageComboBoxItem(item["C_ITEM_NAME"].ToString(), item["C_ID"]);
                repo.Items.Add(list);
            }
            return(repo);
        }
예제 #31
0
        public static RepositoryItemImageComboBox CotCombobox(TreeListColumn column, string LookupTable, string IDField, string DisplayField, string ColumnField)
        {
            column.AppearanceHeader.Options.UseTextOptions = true;
            column.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            column.AppearanceCell.Options.UseTextOptions = true;
            column.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;

            DatabaseFB db = DABase.getDatabase();
            DataSet ds = new DataSet();
            ds = db.LoadTable(LookupTable);

            RepositoryItemImageComboBox rCBB = new RepositoryItemImageComboBox();
            //rCBB.Name = "repositoryItemImageComboBoxCode" + LookupTable;
            foreach (DataRow row in ds.Tables[0].Rows)
                rCBB.Items.Add(new ImageComboBoxItem("" + row[DisplayField].ToString(), row[IDField]));

            column.ColumnEdit = rCBB;
            if (ColumnField != null) column.FieldName = ColumnField;
            return rCBB;
        }
예제 #32
0
 /// <summary>
 /// 初始化RepositoryItemImageComboBox
 /// </summary>
 /// <param name="cbx">RepositoryItemImageComboBox控件</param>
 /// <param name="comboboxno">ComboBox配置编号</param>
 /// <param name="fieldtype">字段类型,如果是I则说明绑定此字段是Int类型,现在只支持Int和String类型的字段</param>
 public static void InitRepositoryItemComboBox(RepositoryItemImageComboBox cbx, string comboboxno,string fieldtype)
 {
     string sSql = "SELECT sGridDisplayField,sGridColumnText, sEnGridColumnText "
                 + "FROM sysLookupSetting "
                 + "WHERE sType='ComboBox' AND sLookupNo='" + comboboxno + "'";
     DataTable dtTmp = DbHelperSQL.Query(sSql).Tables[0];
     if (dtTmp != null && dtTmp.Rows.Count > 0)
     {
         string[] ValueFields = Public.GetSplitString(dtTmp.Rows[0]["sGridDisplayField"].ToString(), ",");
         string[] DisplayText = Public.GetSplitString(LangCenter.Instance.IsDefaultLanguage ?
             dtTmp.Rows[0]["sGridColumnText"].ToString() : dtTmp.Rows[0]["sEnGridColumnText"].ToString(), ",");
         if (ValueFields.Length == DisplayText.Length)
         {
             cbx.Items.Clear();
             for (int i = 0; i < ValueFields.Length; i++)
             {
                 if (fieldtype == "I")
                 {
                     ImageComboBoxItem item = new ImageComboBoxItem();
                     item.Description = DisplayText[i];
                     item.Value = Convert.ToInt32(ValueFields[i]);
                     cbx.Properties.Items.Add(item);
                 }
                 else
                     cbx.Properties.Items.Add(new ImageComboBoxItem(DisplayText[i], ValueFields[i]));
             }
         }
         else
             Public.SystemInfo(LangCenter.Instance.GetSystemMessage("InitComboBoxFailed"), true);
     }
 }
예제 #33
0
 /// <summary>
 /// 初始化RepositoryItemImageComboBox
 /// </summary>
 /// <param name="cbx">RepositoryItemImageComboBox控件</param>
 /// <param name="comboboxno">ComboBox配置编号</param>
 public static void InitRepositoryItemComboBox(RepositoryItemImageComboBox cbx, string comboboxno)
 {
     InitRepositoryItemComboBox(cbx, comboboxno, "");
 }
예제 #34
0
        public void ShowTableViewWithDatatableEnumType()
        {
            //demonstrates how hard it is to add custom editor to tableview for datatable
            //In this case you need 
            //a typeconverter and comboboxhelper :(
            //TODO: look into the differences and abstract away from it
            var dataTable = new DataTable();
            dataTable.Columns.Add("Code", typeof(string));
            dataTable.Columns.Add("SomeEnum", typeof(FruitType));

            for (int i = 0; i < 10; i++)
            {
                dataTable.Rows.Add(new object[] { String.Format("Item{0:000}", i), FruitType.Appel });
            }

            dataTable.AcceptChanges();

            var tableView = new TableView {Data = dataTable};

            var comboBox = new RepositoryItemImageComboBox();
            XtraGridComboBoxHelper.Populate(comboBox, typeof(FruitType));

            tableView.SetColumnEditor(comboBox, 1);
            WindowsFormsTestHelper.ShowModal(tableView);
        }
예제 #35
0
파일: Helpers.cs 프로젝트: shine8319/DLS
 public static void InitPriorityComboBox(RepositoryItemImageComboBox edit) {
     edit.Items.Clear();
     edit.Items.AddRange(new DevExpress.XtraEditors.Controls.ImageComboBoxItem[] {
         new DevExpress.XtraEditors.Controls.ImageComboBoxItem(Properties.Resources.PriorityLow, 0, 0),
         new DevExpress.XtraEditors.Controls.ImageComboBoxItem(Properties.Resources.PriorityMedium, 1, -1),
         new DevExpress.XtraEditors.Controls.ImageComboBoxItem(Properties.Resources.PriorityHigh, 2, 1)});
 }
예제 #36
0
파일: Helpers.cs 프로젝트: shine8319/DLS
        public static void InitTitleComboBox(RepositoryItemImageComboBox edit) {
            //ImageCollection iCollection = new ImageCollection();
            //iCollection.AddImage(Properties.Resources.Doctor);
            //iCollection.AddImage(Properties.Resources.Miss);
            //iCollection.AddImage(Properties.Resources.Mr);
            //iCollection.AddImage(Properties.Resources.Mrs);
            //iCollection.AddImage(Properties.Resources.Ms);
            //iCollection.AddImage(Properties.Resources.Professor);
            //edit.Items.Add(new ImageComboBoxItem(string.Empty, ContactTitle.None, -1));
            //edit.Items.Add(new ImageComboBoxItem(GetTitleNameByContactTitle(ContactTitle.Dr), ContactTitle.Dr, 0));
            //edit.Items.Add(new ImageComboBoxItem(GetTitleNameByContactTitle(ContactTitle.Miss), ContactTitle.Miss, 1));
            //edit.Items.Add(new ImageComboBoxItem(GetTitleNameByContactTitle(ContactTitle.Mr), ContactTitle.Mr, 2));
            //edit.Items.Add(new ImageComboBoxItem(GetTitleNameByContactTitle(ContactTitle.Mrs), ContactTitle.Mrs, 3));
            //edit.Items.Add(new ImageComboBoxItem(GetTitleNameByContactTitle(ContactTitle.Ms), ContactTitle.Ms, 4));
            //edit.Items.Add(new ImageComboBoxItem(GetTitleNameByContactTitle(ContactTitle.Prof), ContactTitle.Prof, 5));
            //edit.SmallImages = iCollection;
            ImageCollection iCollection = new ImageCollection();

            //edit.Items.Add(new ImageComboBoxItem(string.Empty, UserLevel.None, -1));
            edit.Items.Add(new ImageComboBoxItem(GetLevelByUserLevel(UserLevel.Level1), UserLevel.Level1, 0));
            edit.Items.Add(new ImageComboBoxItem(GetLevelByUserLevel(UserLevel.Level2), UserLevel.Level2, 1));
            edit.Items.Add(new ImageComboBoxItem(GetLevelByUserLevel(UserLevel.Level3), UserLevel.Level3, 2));
            
            edit.SmallImages = iCollection;
        }
예제 #37
0
        private RepositoryItemImageComboBox BuildRCBB(string tableName, string valueField, string displayField)
        {
            DatabaseFB db = DABase.getDatabase();
            DataSet ds = new DataSet();
            ds = db.LoadTable(tableName);

            RepositoryItemImageComboBox rCBB = new RepositoryItemImageComboBox();
            rCBB.Name = "repositoryItemImageComboBoxCode" + tableName;

            foreach (DataRow row in ds.Tables[0].Rows)
                rCBB.Items.Add(new DevExpress.XtraEditors.Controls.ImageComboBoxItem(row[displayField].ToString(), (object)row[valueField]));

            return rCBB;
        }
예제 #38
0
파일: Helpers.cs 프로젝트: shine8319/DLS
 public static RepositoryItemImageComboBox CreateFlagStatusImageComboBox(RepositoryItemImageComboBox edit) {
     edit.Items.Clear();
     edit.SmallImages = CreateFlagStatusImageCollection();
     edit.GlyphAlignment = HorzAlignment.Center;
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.Today, FlagStatus.Today, (int)FlagStatus.Today));
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.Tomorrow, FlagStatus.Tomorrow, (int)FlagStatus.Tomorrow));
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.ThisWeek, FlagStatus.ThisWeek, (int)FlagStatus.ThisWeek));
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.NextWeek, FlagStatus.NextWeek, (int)FlagStatus.NextWeek));
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.NoDate, FlagStatus.NoDate, (int)FlagStatus.NoDate));
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.Custom, FlagStatus.Custom, (int)FlagStatus.Custom));
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.Completed, FlagStatus.Completed, (int)FlagStatus.Completed));
     return edit;
 }
예제 #39
0
파일: Helpers.cs 프로젝트: shine8319/DLS
 public static RepositoryItemImageComboBox CreateTaskCategoryImageComboBox(RepositoryItemImageComboBox edit) {
     edit.Items.Clear();
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.TaskCategoryHouseChores, TaskCategory.HouseChores, 0));
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.TaskCategoryShopping, TaskCategory.Shopping, 1));
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.TaskCategoryOffice, TaskCategory.Office, 2));
     return edit;
 }
예제 #40
0
        private GridColumn CreateGridColumn(GridView gv, DataRow dr, BindingSource ds, string tablename, int index, bool isuseredit)
        {
            //******************************特别提示*********************************************
            //Tip:如果要在Grid中取得自定义添加的控件,例如lkp,cbx,mtxt,btxt,mlkp控件
            //lkp控件:用Controls.Find()方法来查找出lkp控件
            //其他类型:用GridControl.RepositoryItems集合中查找
            //***********************************************************************************
            GridColumn cols = new GridColumn();
            string sControlType = dr["sControlType"].ToString();
            switch (sControlType)
            {
                //LookUp查询
                case "lkp":
                    {
                        if (!string.IsNullOrEmpty(dr["sLookupNo"].ToString()))
                        {
                            SunriseLookUp lkp = new SunriseLookUp();
                            lkp.Name = "collkp" + tablename + dr["sFieldName"].ToString();
                            lkp.DataBindings.Add("EditValue", ds, dr["sFieldName"].ToString());
                            this.pnlMain.Controls.Add(lkp);
                            lkp.SendToBack();
                            Base.InitLookup(lkp, dr["sLookupNo"].ToString());
                            if (!string.IsNullOrEmpty(dr["sLookupAutoSetControl"].ToString()))
                            {
                                string[] sItem = Public.GetSplitString(dr["sLookupAutoSetControl"].ToString(), ",");
                                foreach (var s in sItem)
                                {
                                    string[] ss = Public.GetSplitString(s, "=");
                                    lkp.AutoSetValue(ss[0], ss[1]);
                                }
                            }
                            RepositoryItemButtonEdit btnRepositoryItem = new RepositoryItemButtonEdit();
                            btnRepositoryItem.ButtonClick += lkp.LookUpSelfClick;
                            btnRepositoryItem.TextEditStyle = TextEditStyles.DisableTextEditor;
                            //加这句是让了焦点更新,Grid中才会显示新的数据值,其实在后台是已经存在了的,只是在Grid中没有显示出来
                            //此处设置为查询完成后自动跳转到Grid中的下一列中
                            lkp.LookUpAfterPost += new SunriseLookUp.SunriseLookUpEvent(lkp_LookUpAfterPost);
                            cols.ColumnEdit = btnRepositoryItem;
                            gv.GridControl.RepositoryItems.Add(btnRepositoryItem);
                        }
                        break;
                    }
                //下拉框
                case "cbx":
                    {
                        if (!string.IsNullOrEmpty(dr["sLookupNo"].ToString()))
                        {
                            RepositoryItemImageComboBox cbxRepositoryItem = new RepositoryItemImageComboBox();
                            cbxRepositoryItem.Name = "colcbx" + tablename + dr["sFieldName"].ToString();
                            Base.InitRepositoryItemComboBox(cbxRepositoryItem, dr["sLookupNo"].ToString(), dr["sFieldType"].ToString());
                            cols.ColumnEdit = cbxRepositoryItem;
                            gv.GridControl.RepositoryItems.Add(cbxRepositoryItem);
                        }
                        break;
                    }
                //带按钮的文本框
                case "btxt":
                    {
                        RepositoryItemButtonEdit btxtRepositoryItem = new RepositoryItemButtonEdit();
                        btxtRepositoryItem.Name = "colbtxt" + tablename + dr["sFieldName"].ToString();
                        cols.ColumnEdit = btxtRepositoryItem;
                        gv.GridControl.RepositoryItems.Add(btxtRepositoryItem);
                        break;
                    }
                //多行文本框
                case "mtxt":
                    {
                        RepositoryItemMemoExEdit btxtRepositoryItem = new RepositoryItemMemoExEdit();
                        btxtRepositoryItem.Name = "colmtxt" + tablename + dr["sFieldName"].ToString();
                        cols.ColumnEdit = btxtRepositoryItem;
                        gv.GridControl.RepositoryItems.Add(btxtRepositoryItem);
                        break;
                    }
                case "dett":
                    {
                        RepositoryItemDateEdit dettRespositoryItem = new RepositoryItemDateEdit();
                        dettRespositoryItem.Name = "coldett" + tablename + dr["sFieldName"].ToString();
                        dettRespositoryItem.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
                        dettRespositoryItem.DisplayFormat.FormatString = "g";
                        dettRespositoryItem.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
                        dettRespositoryItem.EditFormat.FormatString = "g";

                        dettRespositoryItem.EditMask = "g";
                        cols.ColumnEdit = dettRespositoryItem;
                        gv.GridControl.RepositoryItems.Add(dettRespositoryItem);
                        break;
                    }
                //MLookUp查询
                case "mlkp":
                    {
                        if (!string.IsNullOrEmpty(dr["sLookupNo"].ToString()))
                        {
                            SunriseMLookUp mlkp = new SunriseMLookUp();
                            mlkp.Name = "colmlkp" + tablename + dr["sFieldName"].ToString();
                            mlkp.DataBindings.Add("EditValue", ds, dr["sFieldName"].ToString());
                            mlkp.IsUsedInGrid = true;

                            Base.InitMLookup(mlkp, dr["sLookupNo"].ToString());
                            if (!string.IsNullOrEmpty(dr["sLookupAutoSetControl"].ToString()))
                            {
                                string[] sItem = Public.GetSplitString(dr["sLookupAutoSetControl"].ToString(), ",");
                                foreach (var s in sItem)
                                {
                                    string[] ss = Public.GetSplitString(s, "=");
                                    mlkp.AutoSetValue(ss[0], ss[1]);
                                }
                            }
                            RepositoryItemPopupContainerEdit btnRepositoryItem = new RepositoryItemPopupContainerEdit();
                            btnRepositoryItem.Name = "gridmlkp" + tablename + dr["sFieldName"].ToString();
                            //原本默认的显示Popup的按钮隐藏掉
                            btnRepositoryItem.Buttons[0].Visible = false;
                            btnRepositoryItem.Buttons.Add(new EditorButton(ButtonPredefines.Ellipsis));
                            btnRepositoryItem.ButtonClick += mlkp.LookUpSelfClick;
                            btnRepositoryItem.TextEditStyle = TextEditStyles.Standard;
                            btnRepositoryItem.Popup += mlkp.mlkpDataNo_Popup;
                            btnRepositoryItem.KeyDown += mlkp.mlkpDataNo_KeyDown;
                            btnRepositoryItem.Closed += mlkp.mlkpDataNo_Closed;
                            gv.GridControl.PreviewKeyDown += mlkp.mlkpDataNo_PreviewKeyDown;

                            btnRepositoryItem.PopupControl = mlkp.mlkpPopup;
                            btnRepositoryItem.EditValueChanged += mlkp.mlkpDataNo_TextChanged;

                            //加这句是让了焦点更新,Grid中才会显示新的数据值,其实在后台是已经存在了的,只是在Grid中没有显示出来
                            //此处设置为查询完成后自动跳转到Grid中的下一列中
                            mlkp.LookUpAfterPost += new SunriseLookUp.SunriseLookUpEvent(lkp_LookUpAfterPost);
                            cols.ColumnEdit = btnRepositoryItem;

                            gv.GridControl.RepositoryItems.Add(btnRepositoryItem);
                            this.pnlMain.Controls.Add(mlkp);
                            mlkp.SendToBack();
                            //pnlDynamic.Controls.Add(mlkp);
                            //mlkp.Visible = false;
                        }
                        break;
                    }
            }
            cols.Caption = LangCenter.Instance.IsDefaultLanguage ? dr["sCaption"].ToString() : dr["sEngCaption"].ToString();
            cols.FieldName = dr["sFieldName"].ToString();
            //Grid 列命名为col+表名+列名
            cols.Name = "col" + tablename + dr["sFieldName"].ToString();
            cols.Width = 120;
            if (dr["sColumnType"].ToString() == "002")
            {
                //检测是否有价格权限
                bool HasPrice = SC.CheckAuth(SecurityOperation.Price, FormID);
                if (!HasPrice) return null;

                //设置价格数据显示格式
                cols.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
                cols.DisplayFormat.FormatString = Base.FormatPrice;
            }
            else if (dr["sColumnType"].ToString() == "003")
            {
                //检测是否有数量权限
                bool HasNum = SC.CheckAuth(SecurityOperation.Num, FormID);
                if (!HasNum) return null;

                //设置数量数据显示格式
                cols.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
                cols.DisplayFormat.FormatString = Base.FormatQuantity;
            }
            else
                cols.Visible = true;

            //不需要权限控制的价格数量显示格式化
            //无权限控制价格
            if (dr["sColumnType"].ToString() == "004")
            {
                cols.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
                cols.DisplayFormat.FormatString = Base.FormatNullAuthPrice;
            }
            //无权限控制数量
            else if (dr["sColumnType"].ToString() == "005")
            {
                cols.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
                cols.DisplayFormat.FormatString = Base.FormatNullAuthQuantity;
            }

            cols.VisibleIndex = index;

            //检测窗体字段设置中是否可编辑
            //这里检测的时候是先以窗体设置中的权限优先,窗体上设置不可编辑,用户字段设置可编辑,以窗体上设置为准,不可编辑
            cols.OptionsColumn.AllowEdit = Convert.ToBoolean(dr["bEdit"]);
            //先通过数量和价格权限检测后再设置其用户字段权限
            if (Convert.ToBoolean(dr["bEdit"]))
            {
                cols.OptionsColumn.AllowEdit = isuseredit;
            }

            //Grid Footer显示
            if (dr["sFooterType"].ToString() != "001")
            {
                //001	无
                //002	求和
                //003	计数
                //004	平均值
                //005	最大值
                //006	最小值
                cols.SummaryItem.FieldName = dr["sFieldName"].ToString();
                if (dr["sFooterType"].ToString() == "002")
                    cols.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
                else if (dr["sFooterType"].ToString() == "003")
                    cols.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Count;
                else if (dr["sFooterType"].ToString() == "004")
                    cols.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Average;
                else if (dr["sFooterType"].ToString() == "005")
                    cols.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Max;
                else if (dr["sFooterType"].ToString() == "006")
                    cols.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Min;

                //设置GridFooter汇总格式
                //价格
                if (dr["sColumnType"].ToString() == "002")
                    cols.SummaryItem.DisplayFormat = Base.FormatPrice;
                //数量
                else if (dr["sColumnType"].ToString() == "003")
                    cols.SummaryItem.DisplayFormat = Base.FormatQuantity;
                //无权限控制价格
                else if (dr["sColumnType"].ToString() == "004")
                    cols.SummaryItem.DisplayFormat = Base.FormatNullAuthPrice;
                //无权限控制数量
                else if (dr["sColumnType"].ToString() == "005")
                    cols.SummaryItem.DisplayFormat = Base.FormatNullAuthQuantity;

                gv.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, dr["sFieldName"].ToString(), cols);
            }

            //设置非空字段颜色
            if (Convert.ToBoolean(dr["bSaveData"]) && Convert.ToBoolean(dr["bNotNull"]))
            {
                cols.AppearanceHeader.ForeColor = Color.FromName(Base.GetSystemParamter("001"));
                cols.AppearanceHeader.Options.UseForeColor = true;
            }

            return cols;
        }
예제 #41
0
        private GridColumn CreateGridColumn(GridView gv, DataRow dr, int index)
        {
            GridColumn col = new GridColumn();
            string sControlType = dr["sControlType"].ToString();
            switch (sControlType)
            {
                //下拉框
                case "cbx":
                    {
                        if (!string.IsNullOrEmpty(dr["sLookupNo"].ToString()))
                        {
                            RepositoryItemImageComboBox cbxRepositoryItem = new RepositoryItemImageComboBox();
                            Base.InitRepositoryItemComboBox(cbxRepositoryItem, dr["sLookupNo"].ToString(), dr["sFieldType"].ToString());
                            col.ColumnEdit = cbxRepositoryItem;
                            gv.GridControl.RepositoryItems.Add(cbxRepositoryItem);
                        }
                        break;
                    }
                case "dett":
                    {
                        RepositoryItemDateEdit dettRespositoryItem = new RepositoryItemDateEdit();
                        dettRespositoryItem.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
                        dettRespositoryItem.DisplayFormat.FormatString = "g";
                        dettRespositoryItem.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
                        dettRespositoryItem.EditFormat.FormatString = "g";

                        dettRespositoryItem.EditMask = "g";
                        col.ColumnEdit = dettRespositoryItem;
                        gv.GridControl.RepositoryItems.Add(dettRespositoryItem);
                        break;
                    }
            }
            col.Caption = LangCenter.Instance.IsDefaultLanguage ? dr["sCaption"].ToString() : dr["sEngCaption"].ToString();
            col.FieldName = dr["sFieldName"].ToString();
            //Grid 列命名为col+表名+字段名
            col.Name = "col" + MasterTableName + dr["sFieldName"].ToString();
            col.Width = 120;
            if (dr["sColumnType"].ToString() == "002")
            {
                //检测是否有价格权限
                bool HasPrice = SC.CheckAuth(SecurityOperation.Price, FormID);
                if (!HasPrice) return null;

                //设置价格数据显示格式
                col.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
                col.DisplayFormat.FormatString = Base.FormatPrice;
            }
            else if (dr["sColumnType"].ToString() == "003")
            {
                //检测是否有数量权限
                bool HasNum = SC.CheckAuth(SecurityOperation.Num, FormID);
                if (!HasNum) return null;

                //设置数量数据显示格式
                col.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
                col.DisplayFormat.FormatString = Base.FormatQuantity;
            }
            else
                col.Visible = true;

            //不需要权限控制的价格数量显示格式化
            //无权限控制价格
            if (dr["sColumnType"].ToString() == "004")
            {
                col.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
                col.DisplayFormat.FormatString = Base.FormatNullAuthPrice;
            }
            //无权限控制数量
            else if (dr["sColumnType"].ToString() == "005")
            {
                col.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
                col.DisplayFormat.FormatString = Base.FormatNullAuthQuantity;
            }

            col.VisibleIndex = index;
            col.OptionsColumn.AllowEdit = Convert.ToBoolean(dr["bEdit"] == null ? 1 : dr["bEdit"]);
            //Grid Footer显示
            if (dr["sFooterType"].ToString() != "001")
            {
                //001	无
                //002	求和
                //003	计数
                //004	平均值
                //005	最大值
                //006	最小值
                col.SummaryItem.FieldName = dr["sFieldName"].ToString();
                if (dr["sFooterType"].ToString() == "002")
                    col.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
                else if (dr["sFooterType"].ToString() == "003")
                    col.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Count;
                else if (dr["sFooterType"].ToString() == "004")
                    col.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Average;
                else if (dr["sFooterType"].ToString() == "005")
                    col.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Max;
                else if (dr["sFooterType"].ToString() == "006")
                    col.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Min;

                gv.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, dr["sFieldName"].ToString(), col);
            }
            return col;
        }
예제 #42
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="gv"></param>
        /// <param name="dr"></param>
        /// <param name="tableName"></param>
        /// <param name="index"></param>
        /// <param name="isuseredit"></param>
        /// <param name="formID"></param>
        /// <returns></returns>
        public static GridColumn GridCreateColumn(Form frm, GridView gv, DataRow drConfig, string tableName, int index, bool allowEdit, int formID, object lpkBindSource, SunriseLookUp.SunriseLookUpEvent slookHandler)
        {
            GridColumn gc = new GridColumn();
            string sControlType = drConfig["sControlType"].ToString();
            string sFieldName = drConfig["sFieldName"].ToString();
            string sLookupNo = drConfig["sLookupNo"].ToString();
            string sColumnType = drConfig["sColumnType"].ToString();
            #region 设置ColumnEdit
            switch (sControlType)
            {
                case "lkp":
                    #region LookUp查询
                    if (!string.IsNullOrEmpty(sLookupNo) && lpkBindSource != null)
                    {
                        SunriseLookUp lkp = new SunriseLookUp();
                        lkp.Name = string.Format("collkp{0}{1}", tableName, sFieldName);
                        lkp.DataBindings.Add("EditValue", lpkBindSource, sFieldName);
                        Base.InitLookup(lkp, sLookupNo);
                        string sLookupAutoSetControl = drConfig["sLookupAutoSetControl"].ToString();
                        if (!string.IsNullOrEmpty(sLookupAutoSetControl))
                        {
                            string[] sItem = Public.GetSplitString(sLookupAutoSetControl, ",");
                            foreach (var s in sItem)
                            {
                                string[] ss = Public.GetSplitString(s, "=");
                                lkp.AutoSetValue(ss[0], ss[1]);
                            }
                        }
                        RepositoryItemButtonEdit btnRepositoryItem = new RepositoryItemButtonEdit();
                        btnRepositoryItem.ButtonClick += lkp.LookUpSelfClick;
                        btnRepositoryItem.TextEditStyle = TextEditStyles.DisableTextEditor;
                        //加这句是让了焦点更新,Grid中才会显示新的数据值,其实在后台是已经存在了的,只是在Grid中没有显示出来
                        //此处设置为查询完成后自动跳转到Grid中的下一列中
                        if (slookHandler != null) lkp.LookUpAfterPost += slookHandler;
                        //if (slookHandler != null) lkp.LookUpAfterPost += new SunriseLookUp.SunriseLookUpEvent(lkp_LookUpAfterPost);
                        gc.ColumnEdit = btnRepositoryItem;
                        gv.GridControl.RepositoryItems.Add(btnRepositoryItem);
                    }
                    break;
                    #endregion
                case "cbx":
                    #region 下拉框
                    if (!string.IsNullOrEmpty(sLookupNo))
                    {
                        RepositoryItemImageComboBox cbxRepositoryItem = new RepositoryItemImageComboBox();
                        Base.InitRepositoryItemComboBox(cbxRepositoryItem, sLookupNo, (string)drConfig["sFieldType"]);
                        gc.ColumnEdit = cbxRepositoryItem;
                        gv.GridControl.RepositoryItems.Add(cbxRepositoryItem);
                    }
                    break;
                    #endregion
                case "btxt":
                    #region 带按钮的文本框
                    RepositoryItemMemoExEdit btxtRepositoryItem = new RepositoryItemMemoExEdit();
                    gc.ColumnEdit = btxtRepositoryItem;
                    gv.GridControl.RepositoryItems.Add(btxtRepositoryItem);
                    break;
                    #endregion
                //modify by han
                #region
                //多行文本框
                case "mtxt":

                    RepositoryItemMemoExEdit mtxtRepositoryItem = new RepositoryItemMemoExEdit();
                    mtxtRepositoryItem.Name = "colmtxt" + tableName + drConfig["sFieldName"].ToString();
                    gc.ColumnEdit = mtxtRepositoryItem;
                    gv.GridControl.RepositoryItems.Add(mtxtRepositoryItem);
                    break;
                case "dett":
                    RepositoryItemDateEdit dettRespositoryItem = new RepositoryItemDateEdit();
                    dettRespositoryItem.Name = "coldett" + tableName + drConfig["sFieldName"].ToString();
                    dettRespositoryItem.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
                    dettRespositoryItem.DisplayFormat.FormatString = "g";
                    dettRespositoryItem.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
                    dettRespositoryItem.EditFormat.FormatString = "g";

                    dettRespositoryItem.EditMask = "g";
                    gc.ColumnEdit = dettRespositoryItem;
                    gv.GridControl.RepositoryItems.Add(dettRespositoryItem);
                    break;
                //MLookUp查询
                case "mlkp":
                    {
                        if (!string.IsNullOrEmpty(drConfig["sLookupNo"].ToString()))
                        {
                            SunriseMLookUp mlkp = new SunriseMLookUp();
                            mlkp.Name = "colmlkp" + tableName + drConfig["sFieldName"].ToString();
                            mlkp.DataBindings.Add("EditValue", lpkBindSource, drConfig["sFieldName"].ToString());
                            mlkp.IsUsedInGrid = true;

                            Base.InitMLookup(mlkp, drConfig["sLookupNo"].ToString());
                            if (!string.IsNullOrEmpty(drConfig["sLookupAutoSetControl"].ToString()))
                            {
                                string[] sItem = Public.GetSplitString(drConfig["sLookupAutoSetControl"].ToString(), ",");
                                foreach (var s in sItem)
                                {
                                    string[] ss = Public.GetSplitString(s, "=");
                                    mlkp.AutoSetValue(ss[0], ss[1]);
                                }
                            }
                            RepositoryItemPopupContainerEdit btnRepositoryItem = new RepositoryItemPopupContainerEdit();
                            btnRepositoryItem.Name = "gridmlkp" + tableName + drConfig["sFieldName"].ToString();
                            //原本默认的显示Popup的按钮隐藏掉
                            btnRepositoryItem.Buttons[0].Visible = false;
                            btnRepositoryItem.Buttons.Add(new EditorButton(ButtonPredefines.Ellipsis));
                            btnRepositoryItem.ButtonClick += mlkp.LookUpSelfClick;
                            btnRepositoryItem.TextEditStyle = TextEditStyles.Standard;
                            btnRepositoryItem.Popup += mlkp.mlkpDataNo_Popup;
                            btnRepositoryItem.KeyDown += mlkp.mlkpDataNo_KeyDown;
                            btnRepositoryItem.Closed += mlkp.mlkpDataNo_Closed;
                            gv.GridControl.PreviewKeyDown += mlkp.mlkpDataNo_PreviewKeyDown;

                            btnRepositoryItem.PopupControl = mlkp.mlkpPopup;
                            btnRepositoryItem.EditValueChanged += mlkp.mlkpDataNo_TextChanged;

                            //加这句是让了焦点更新,Grid中才会显示新的数据值,其实在后台是已经存在了的,只是在Grid中没有显示出来
                            //此处设置为查询完成后自动跳转到Grid中的下一列中
                            // mlkp.LookUpAfterPost += new SunriseLookUp.SunriseLookUpEvent(lkp_LookUpAfterPost);
                            mlkp.LookUpAfterPost += slookHandler;

                            gc.ColumnEdit = btnRepositoryItem;
                            gv.GridControl.RepositoryItems.Add(btnRepositoryItem);
                            frm.Controls.Add(mlkp);
                            mlkp.Location = new Point(frm.Size.Height / 2, frm.Size.Width / 2);
                            mlkp.SendToBack();
                        }
                        break;
                    }
                #endregion
            }
            #endregion
            gc.Caption = LangCenter.Instance.IsDefaultLanguage ? drConfig["sCaption"].ToString() : drConfig["sEngCaption"].ToString();
            gc.FieldName = sFieldName;
            gc.Name = string.Format("col{0}{1}", tableName, sFieldName);//Grid 列命名为col+表名+列名
            gc.Width = 120;
            if (sColumnType == "002" && !SC.CheckAuth(SecurityOperation.Price, formID)) return null;//检测是否有价格权限
            if (sColumnType == "003" && !SC.CheckAuth(SecurityOperation.Num, formID)) return null;//检测是否有数量权限
            gc.Visible = true;
            gc.VisibleIndex = index;
            #region 检测窗体字段设置中是否可编辑
            //这里检测的时候是先以窗体设置中的权限优先,窗体上设置不可编辑,用户字段设置可编辑,以窗体上设置为准,不可编辑
            bool bEdit = Convert.ToBoolean(drConfig["bEdit"]);
            //先通过数量和价格权限检测后再设置其用户字段权限
            if (bEdit) bEdit = allowEdit;
            gc.OptionsColumn.AllowEdit = bEdit;
            #endregion
            #region Grid Footer显示
            string sFooterType = (string)drConfig["sFooterType"];
            gc.SummaryItem.FieldName = sFieldName;
            DevExpress.Data.SummaryItemType sitype = DevExpress.Data.SummaryItemType.None;
            if (sFooterType == "001") sitype = DevExpress.Data.SummaryItemType.None;  //001	无
            if (sFooterType == "002") sitype = DevExpress.Data.SummaryItemType.Sum;//002	求和
            if (sFooterType == "003") sitype = DevExpress.Data.SummaryItemType.Count;//003	计数
            if (sFooterType == "004") sitype = DevExpress.Data.SummaryItemType.Average;//004	平均值
            if (sFooterType == "005") sitype = DevExpress.Data.SummaryItemType.Max;//005	最大值
            if (sFooterType == "006") sitype = DevExpress.Data.SummaryItemType.Min;//006	最小值
            gc.SummaryItem.SummaryType = sitype;
            if (sitype != DevExpress.Data.SummaryItemType.None) gv.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, sFieldName, gc);
            #endregion

            //modify by han
            //设置非空字段颜色
            if (Convert.ToBoolean(drConfig["bSaveData"]) && Convert.ToBoolean(drConfig["bNotNull"]))
            {
                gc.AppearanceHeader.ForeColor = Color.FromName(Base.GetSystemParamter("001"));
                gc.AppearanceHeader.Options.UseForeColor = true;
            }

            return gc;
        }
예제 #43
0
 private void InitializeComponent()
 {
     this.components = new Container();
     ComponentResourceManager manager = new ComponentResourceManager(typeof(DlgSupcomMapOptions));
     this.gpgMapSelectGrid = new GPGChatGrid();
     this.cardView1 = new CardView();
     this.colMapTitle = new GridColumn();
     this.colStatus = new GridColumn();
     this.riPriority = new RepositoryItemImageComboBox();
     this.ilThumbs = new ImageList(this.components);
     this.colMap = new GridColumn();
     this.riMap = new RepositoryItemPictureEdit();
     this.rimPictureEdit3 = new RepositoryItemPictureEdit();
     this.rimTextEdit = new RepositoryItemTextEdit();
     this.rimMemoEdit3 = new RepositoryItemMemoEdit();
     this.riPopup = new RepositoryItemPopupContainerEdit();
     this.repositoryItemTimeEdit1 = new RepositoryItemTimeEdit();
     this.repositoryItemTextEdit1 = new RepositoryItemTextEdit();
     this.riPictureStatus = new RepositoryItemPictureEdit();
     this.riButtonStatus = new RepositoryItemButtonEdit();
     this.riTextPriority = new RepositoryItemTextEdit();
     this.colTime = new GridColumn();
     this.colType = new GridColumn();
     this.colDescription = new GridColumn();
     this.colData = new GridColumn();
     this.rbAeon = new RadioButton();
     this.rbCybran = new RadioButton();
     this.rbUEF = new RadioButton();
     this.rbRandom = new RadioButton();
     this.lMapPrefs = new GPGLabel();
     this.gpgLabel1 = new GPGLabel();
     this.skinButtonCancel = new SkinButton();
     this.skinButtonSearch = new SkinButton();
     this.rbSeraphim = new RadioButton();
     ((ISupportInitialize) base.pbBottom).BeginInit();
     this.gpgMapSelectGrid.BeginInit();
     this.cardView1.BeginInit();
     this.riPriority.BeginInit();
     this.riMap.BeginInit();
     this.rimPictureEdit3.BeginInit();
     this.rimTextEdit.BeginInit();
     this.rimMemoEdit3.BeginInit();
     this.riPopup.BeginInit();
     this.repositoryItemTimeEdit1.BeginInit();
     this.repositoryItemTextEdit1.BeginInit();
     this.riPictureStatus.BeginInit();
     this.riButtonStatus.BeginInit();
     this.riTextPriority.BeginInit();
     base.SuspendLayout();
     base.pbBottom.Size = new Size(0x3c5, 0x39);
     base.ttDefault.SetSuperTip(base.pbBottom, null);
     base.ttDefault.DefaultController.AutoPopDelay = 0x3e8;
     base.ttDefault.DefaultController.ToolTipLocation = ToolTipLocation.RightTop;
     this.gpgMapSelectGrid.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
     this.gpgMapSelectGrid.CustomizeStyle = false;
     this.gpgMapSelectGrid.EmbeddedNavigator.Name = "";
     this.gpgMapSelectGrid.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.gpgMapSelectGrid.IgnoreMouseWheel = false;
     this.gpgMapSelectGrid.Location = new Point(12, 0x55);
     this.gpgMapSelectGrid.LookAndFeel.SkinName = "Money Twins";
     this.gpgMapSelectGrid.LookAndFeel.Style = LookAndFeelStyle.Office2003;
     this.gpgMapSelectGrid.LookAndFeel.UseDefaultLookAndFeel = false;
     this.gpgMapSelectGrid.MainView = this.cardView1;
     this.gpgMapSelectGrid.Name = "gpgMapSelectGrid";
     this.gpgMapSelectGrid.RepositoryItems.AddRange(new RepositoryItem[] { this.rimPictureEdit3, this.rimTextEdit, this.rimMemoEdit3, this.riPopup, this.repositoryItemTimeEdit1, this.riPriority, this.riMap, this.repositoryItemTextEdit1, this.riPictureStatus, this.riButtonStatus, this.riTextPriority });
     this.gpgMapSelectGrid.ShowOnlyPredefinedDetails = true;
     this.gpgMapSelectGrid.Size = new Size(0x3e8, 0x12b);
     this.gpgMapSelectGrid.TabIndex = 0x1d;
     this.gpgMapSelectGrid.ViewCollection.AddRange(new BaseView[] { this.cardView1 });
     this.cardView1.Appearance.Card.BackColor = Color.Black;
     this.cardView1.Appearance.Card.ForeColor = Color.White;
     this.cardView1.Appearance.Card.Options.UseBackColor = true;
     this.cardView1.Appearance.Card.Options.UseForeColor = true;
     this.cardView1.Appearance.EmptySpace.BackColor = Color.Black;
     this.cardView1.Appearance.EmptySpace.Options.UseBackColor = true;
     this.cardView1.Appearance.FieldCaption.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.cardView1.Appearance.FieldCaption.ForeColor = Color.FromArgb(0x8f, 0xbd, 0xd1);
     this.cardView1.Appearance.FieldCaption.Options.UseFont = true;
     this.cardView1.Appearance.FieldCaption.Options.UseForeColor = true;
     this.cardView1.Appearance.FieldValue.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.cardView1.Appearance.FieldValue.ForeColor = Color.White;
     this.cardView1.Appearance.FieldValue.Options.UseFont = true;
     this.cardView1.Appearance.FieldValue.Options.UseForeColor = true;
     this.cardView1.Appearance.FilterCloseButton.BackColor = Color.FromArgb(0xd4, 0xd0, 200);
     this.cardView1.Appearance.FilterCloseButton.BackColor2 = Color.FromArgb(90, 90, 90);
     this.cardView1.Appearance.FilterCloseButton.BorderColor = Color.FromArgb(0xd4, 0xd0, 200);
     this.cardView1.Appearance.FilterCloseButton.ForeColor = Color.Black;
     this.cardView1.Appearance.FilterCloseButton.GradientMode = LinearGradientMode.ForwardDiagonal;
     this.cardView1.Appearance.FilterCloseButton.Options.UseBackColor = true;
     this.cardView1.Appearance.FilterCloseButton.Options.UseBorderColor = true;
     this.cardView1.Appearance.FilterCloseButton.Options.UseForeColor = true;
     this.cardView1.Appearance.FilterPanel.BackColor = Color.Black;
     this.cardView1.Appearance.FilterPanel.BackColor2 = Color.FromArgb(0xd4, 0xd0, 200);
     this.cardView1.Appearance.FilterPanel.ForeColor = Color.White;
     this.cardView1.Appearance.FilterPanel.GradientMode = LinearGradientMode.ForwardDiagonal;
     this.cardView1.Appearance.FilterPanel.Options.UseBackColor = true;
     this.cardView1.Appearance.FilterPanel.Options.UseForeColor = true;
     this.cardView1.Appearance.SeparatorLine.BackColor = Color.Black;
     this.cardView1.Appearance.SeparatorLine.Options.UseBackColor = true;
     this.cardView1.BorderStyle = BorderStyles.NoBorder;
     this.cardView1.Columns.AddRange(new GridColumn[] { this.colMapTitle, this.colStatus, this.colMap });
     this.cardView1.DetailHeight = 400;
     this.cardView1.FocusedCardTopFieldIndex = 0;
     this.cardView1.GridControl = this.gpgMapSelectGrid;
     this.cardView1.Name = "cardView1";
     this.cardView1.OptionsBehavior.AllowExpandCollapse = false;
     this.cardView1.OptionsBehavior.AutoPopulateColumns = false;
     this.cardView1.OptionsBehavior.FieldAutoHeight = true;
     this.cardView1.OptionsBehavior.Sizeable = false;
     this.cardView1.OptionsSelection.MultiSelect = true;
     this.cardView1.OptionsView.ShowCardCaption = false;
     this.cardView1.OptionsView.ShowFieldCaptions = false;
     this.cardView1.OptionsView.ShowQuickCustomizeButton = false;
     this.cardView1.VertScrollVisibility = ScrollVisibility.Auto;
     this.cardView1.CustomDrawCardField += new RowCellCustomDrawEventHandler(this.cardView1_CustomDrawCardField);
     this.cardView1.Click += new EventHandler(this.cardView1_Click);
     this.colMapTitle.AppearanceCell.BackColor = Color.FromArgb(0x1b, 0x2e, 0x4a);
     this.colMapTitle.AppearanceCell.BackColor2 = Color.FromArgb(12, 0x17, 0x29);
     this.colMapTitle.AppearanceCell.Font = new Font("Arial", 10f, FontStyle.Bold, GraphicsUnit.Point, 0);
     this.colMapTitle.AppearanceCell.ForeColor = Color.FromArgb(0x8f, 0xbd, 0xd1);
     this.colMapTitle.AppearanceCell.GradientMode = LinearGradientMode.ForwardDiagonal;
     this.colMapTitle.AppearanceCell.Options.UseBackColor = true;
     this.colMapTitle.AppearanceCell.Options.UseFont = true;
     this.colMapTitle.AppearanceCell.Options.UseForeColor = true;
     this.colMapTitle.AppearanceCell.Options.UseTextOptions = true;
     this.colMapTitle.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
     this.colMapTitle.AppearanceCell.TextOptions.Trimming = Trimming.None;
     this.colMapTitle.AppearanceCell.TextOptions.VAlignment = VertAlignment.Top;
     this.colMapTitle.AppearanceHeader.Font = new Font("Arial", 12f, FontStyle.Bold, GraphicsUnit.Point, 0);
     this.colMapTitle.AppearanceHeader.Options.UseFont = true;
     this.colMapTitle.Caption = "Map Name";
     this.colMapTitle.FieldName = "Description";
     this.colMapTitle.Name = "colMapTitle";
     this.colMapTitle.OptionsColumn.AllowEdit = false;
     this.colMapTitle.Visible = true;
     this.colMapTitle.VisibleIndex = 0;
     this.colStatus.AppearanceCell.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.colStatus.AppearanceCell.Options.UseFont = true;
     this.colStatus.AppearanceCell.Options.UseTextOptions = true;
     this.colStatus.AppearanceCell.TextOptions.Trimming = Trimming.None;
     this.colStatus.AppearanceCell.TextOptions.VAlignment = VertAlignment.Center;
     this.colStatus.Caption = "Priority";
     this.colStatus.ColumnEdit = this.riPriority;
     this.colStatus.FieldName = "Priority";
     this.colStatus.Name = "colStatus";
     this.colStatus.OptionsColumn.AllowEdit = false;
     this.colStatus.OptionsColumn.AllowFocus = false;
     this.colStatus.OptionsColumn.ReadOnly = true;
     this.colStatus.ShowButtonMode = ShowButtonModeEnum.ShowOnlyInEditor;
     this.colStatus.Visible = true;
     this.colStatus.VisibleIndex = 1;
     this.riPriority.AllowNullInput = DefaultBoolean.True;
     this.riPriority.Appearance.BackColor = Color.Black;
     this.riPriority.Appearance.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.riPriority.Appearance.ForeColor = Color.White;
     this.riPriority.Appearance.Options.UseBackColor = true;
     this.riPriority.Appearance.Options.UseFont = true;
     this.riPriority.Appearance.Options.UseForeColor = true;
     this.riPriority.AppearanceDropDown.BackColor = Color.Black;
     this.riPriority.AppearanceDropDown.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.riPriority.AppearanceDropDown.ForeColor = Color.White;
     this.riPriority.AppearanceDropDown.Options.UseBackColor = true;
     this.riPriority.AppearanceDropDown.Options.UseFont = true;
     this.riPriority.AppearanceDropDown.Options.UseForeColor = true;
     this.riPriority.AutoHeight = false;
     this.riPriority.DropDownRows = 3;
     this.riPriority.HideSelection = false;
     this.riPriority.Items.AddRange(new ImageComboBoxItem[] { new ImageComboBoxItem("<LOC>Neutral", null, 0), new ImageComboBoxItem("<LOC>Thumbs Up", true, 1), new ImageComboBoxItem("<LOC>Thumbs Down", false, 2) });
     this.riPriority.LargeImages = this.ilThumbs;
     this.riPriority.Name = "riPriority";
     this.riPriority.Validating += new CancelEventHandler(this.riPriority_Validating);
     this.ilThumbs.ImageStream = (ImageListStreamer) manager.GetObject("ilThumbs.ImageStream");
     this.ilThumbs.TransparentColor = Color.Transparent;
     this.ilThumbs.Images.SetKeyName(0, "neutral.png");
     this.ilThumbs.Images.SetKeyName(1, "thumbsup.png");
     this.ilThumbs.Images.SetKeyName(2, "thumbsdown.png");
     this.colMap.Caption = "Image";
     this.colMap.ColumnEdit = this.riMap;
     this.colMap.FieldName = "Thumbnail";
     this.colMap.Name = "colMap";
     this.colMap.OptionsColumn.AllowEdit = false;
     this.colMap.Visible = true;
     this.colMap.VisibleIndex = 2;
     this.riMap.CustomHeight = 200;
     this.riMap.Name = "riMap";
     this.riMap.SizeMode = PictureSizeMode.Stretch;
     this.rimPictureEdit3.Name = "rimPictureEdit3";
     this.rimPictureEdit3.PictureAlignment = ContentAlignment.TopCenter;
     this.rimTextEdit.AutoHeight = false;
     this.rimTextEdit.Name = "rimTextEdit";
     this.rimMemoEdit3.MaxLength = 500;
     this.rimMemoEdit3.Name = "rimMemoEdit3";
     this.riPopup.AutoHeight = false;
     this.riPopup.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
     this.riPopup.Name = "riPopup";
     this.repositoryItemTimeEdit1.AutoHeight = false;
     this.repositoryItemTimeEdit1.Buttons.AddRange(new EditorButton[] { new EditorButton() });
     this.repositoryItemTimeEdit1.Name = "repositoryItemTimeEdit1";
     this.repositoryItemTextEdit1.Appearance.Font = new Font("Arial", 12f, FontStyle.Bold, GraphicsUnit.Point, 0);
     this.repositoryItemTextEdit1.Appearance.Options.UseFont = true;
     this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
     this.riPictureStatus.Name = "riPictureStatus";
     this.riPictureStatus.PictureAlignment = ContentAlignment.MiddleLeft;
     this.riPictureStatus.ReadOnly = true;
     this.riPictureStatus.Click += new EventHandler(this.riTextPriority_Click);
     this.riButtonStatus.AllowFocused = false;
     this.riButtonStatus.AllowNullInput = DefaultBoolean.True;
     this.riButtonStatus.AutoHeight = false;
     this.riButtonStatus.Name = "riButtonStatus";
     this.riButtonStatus.ReadOnly = true;
     this.riButtonStatus.TextEditStyle = TextEditStyles.DisableTextEditor;
     this.riButtonStatus.Click += new EventHandler(this.riTextPriority_Click);
     this.riButtonStatus.ButtonClick += new ButtonPressedEventHandler(this.riButtonStatus_ButtonClick);
     this.riTextPriority.AutoHeight = false;
     this.riTextPriority.Name = "riTextPriority";
     this.riTextPriority.ReadOnly = true;
     this.riTextPriority.Click += new EventHandler(this.riTextPriority_Click);
     this.colTime.Caption = "Time";
     this.colTime.ColumnEdit = this.repositoryItemTimeEdit1;
     this.colTime.FieldName = "DateTime";
     this.colTime.Name = "colTime";
     this.colTime.OptionsColumn.AllowEdit = false;
     this.colTime.Visible = true;
     this.colTime.VisibleIndex = 0;
     this.colType.Caption = "Type";
     this.colType.FieldName = "LogType";
     this.colType.Name = "colType";
     this.colType.OptionsColumn.AllowEdit = false;
     this.colType.Visible = true;
     this.colType.VisibleIndex = 1;
     this.colDescription.Caption = "Description";
     this.colDescription.FieldName = "Description";
     this.colDescription.Name = "colDescription";
     this.colDescription.OptionsColumn.AllowEdit = false;
     this.colDescription.Visible = true;
     this.colDescription.VisibleIndex = 2;
     this.colData.Caption = "Data";
     this.colData.ColumnEdit = this.riPopup;
     this.colData.FieldName = "Data";
     this.colData.Name = "colData";
     this.colData.Visible = true;
     this.colData.VisibleIndex = 3;
     this.rbAeon.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
     this.rbAeon.CheckAlign = ContentAlignment.BottomCenter;
     this.rbAeon.FlatStyle = FlatStyle.Flat;
     this.rbAeon.Image = Resources.aeon1;
     this.rbAeon.ImageAlign = ContentAlignment.TopCenter;
     this.rbAeon.Location = new Point(12, 0x1a7);
     this.rbAeon.Name = "rbAeon";
     this.rbAeon.Size = new Size(0xc6, 0xf5);
     base.ttDefault.SetSuperTip(this.rbAeon, null);
     this.rbAeon.TabIndex = 0x25;
     this.rbAeon.Text = "Aeon";
     this.rbAeon.TextAlign = ContentAlignment.BottomCenter;
     this.rbAeon.TextImageRelation = TextImageRelation.TextAboveImage;
     this.rbAeon.UseVisualStyleBackColor = true;
     this.rbAeon.Paint += new PaintEventHandler(this.rbRandom_Paint);
     this.rbAeon.CheckedChanged += new EventHandler(this.rbAeon_CheckedChanged);
     this.rbCybran.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
     this.rbCybran.CheckAlign = ContentAlignment.BottomCenter;
     this.rbCybran.FlatStyle = FlatStyle.Flat;
     this.rbCybran.Image = Resources.cybran1;
     this.rbCybran.ImageAlign = ContentAlignment.TopCenter;
     this.rbCybran.Location = new Point(0xd0, 0x1a7);
     this.rbCybran.Name = "rbCybran";
     this.rbCybran.Size = new Size(0xc6, 0xf5);
     base.ttDefault.SetSuperTip(this.rbCybran, null);
     this.rbCybran.TabIndex = 0x26;
     this.rbCybran.Text = "Cybran";
     this.rbCybran.TextAlign = ContentAlignment.BottomCenter;
     this.rbCybran.TextImageRelation = TextImageRelation.TextAboveImage;
     this.rbCybran.UseVisualStyleBackColor = true;
     this.rbCybran.Paint += new PaintEventHandler(this.rbRandom_Paint);
     this.rbCybran.CheckedChanged += new EventHandler(this.rbAeon_CheckedChanged);
     this.rbUEF.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
     this.rbUEF.CheckAlign = ContentAlignment.BottomCenter;
     this.rbUEF.FlatStyle = FlatStyle.Flat;
     this.rbUEF.Image = Resources.uef1;
     this.rbUEF.ImageAlign = ContentAlignment.TopCenter;
     this.rbUEF.Location = new Point(410, 0x1a7);
     this.rbUEF.Name = "rbUEF";
     this.rbUEF.Size = new Size(0xc6, 0xf5);
     base.ttDefault.SetSuperTip(this.rbUEF, null);
     this.rbUEF.TabIndex = 0x27;
     this.rbUEF.Text = "UEF";
     this.rbUEF.TextAlign = ContentAlignment.BottomCenter;
     this.rbUEF.TextImageRelation = TextImageRelation.TextAboveImage;
     this.rbUEF.UseVisualStyleBackColor = true;
     this.rbUEF.Paint += new PaintEventHandler(this.rbRandom_Paint);
     this.rbUEF.CheckedChanged += new EventHandler(this.rbAeon_CheckedChanged);
     this.rbRandom.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
     this.rbRandom.BackColor = Color.Black;
     this.rbRandom.CheckAlign = ContentAlignment.BottomCenter;
     this.rbRandom.Checked = true;
     this.rbRandom.FlatStyle = FlatStyle.Flat;
     this.rbRandom.Image = Resources.random1;
     this.rbRandom.ImageAlign = ContentAlignment.TopCenter;
     this.rbRandom.Location = new Point(0x329, 0x1a7);
     this.rbRandom.Name = "rbRandom";
     this.rbRandom.Size = new Size(0xc6, 0xf5);
     base.ttDefault.SetSuperTip(this.rbRandom, null);
     this.rbRandom.TabIndex = 40;
     this.rbRandom.TabStop = true;
     this.rbRandom.Text = "<LOC>Random";
     this.rbRandom.TextAlign = ContentAlignment.BottomCenter;
     this.rbRandom.TextImageRelation = TextImageRelation.TextAboveImage;
     this.rbRandom.UseVisualStyleBackColor = false;
     this.rbRandom.Paint += new PaintEventHandler(this.rbRandom_Paint);
     this.rbRandom.CheckedChanged += new EventHandler(this.rbAeon_CheckedChanged);
     this.lMapPrefs.AutoGrowDirection = GrowDirections.None;
     this.lMapPrefs.AutoSize = true;
     this.lMapPrefs.AutoStyle = true;
     this.lMapPrefs.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.lMapPrefs.ForeColor = Color.White;
     this.lMapPrefs.IgnoreMouseWheel = false;
     this.lMapPrefs.IsStyled = false;
     this.lMapPrefs.Location = new Point(0x15, 0x3e);
     this.lMapPrefs.Name = "lMapPrefs";
     this.lMapPrefs.Size = new Size(0x263, 0x10);
     base.ttDefault.SetSuperTip(this.lMapPrefs, null);
     this.lMapPrefs.TabIndex = 0x29;
     this.lMapPrefs.Text = "<LOC>Step 1: Select your map preferences -- you may have only one thumbs up and one thumbs down.";
     this.lMapPrefs.TextStyle = TextStyles.Default;
     this.gpgLabel1.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
     this.gpgLabel1.AutoGrowDirection = GrowDirections.None;
     this.gpgLabel1.AutoSize = true;
     this.gpgLabel1.AutoStyle = true;
     this.gpgLabel1.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.gpgLabel1.ForeColor = Color.White;
     this.gpgLabel1.IgnoreMouseWheel = false;
     this.gpgLabel1.IsStyled = false;
     this.gpgLabel1.Location = new Point(12, 0x189);
     this.gpgLabel1.Name = "gpgLabel1";
     this.gpgLabel1.Size = new Size(0xcc, 0x10);
     base.ttDefault.SetSuperTip(this.gpgLabel1, null);
     this.gpgLabel1.TabIndex = 0x2a;
     this.gpgLabel1.Text = "<LOC>Step 2: Select your faction";
     this.gpgLabel1.TextStyle = TextStyles.Default;
     this.skinButtonCancel.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
     this.skinButtonCancel.AutoStyle = true;
     this.skinButtonCancel.BackColor = Color.Black;
     this.skinButtonCancel.ButtonState = 0;
     this.skinButtonCancel.DialogResult = DialogResult.OK;
     this.skinButtonCancel.DisabledForecolor = Color.Gray;
     this.skinButtonCancel.DrawColor = Color.White;
     this.skinButtonCancel.DrawEdges = true;
     this.skinButtonCancel.FocusColor = Color.Yellow;
     this.skinButtonCancel.Font = new Font("Verdana", 8f, FontStyle.Bold);
     this.skinButtonCancel.ForeColor = Color.White;
     this.skinButtonCancel.HorizontalScalingMode = ScalingModes.Tile;
     this.skinButtonCancel.IsStyled = true;
     this.skinButtonCancel.Location = new Point(870, 0x2a2);
     this.skinButtonCancel.Name = "skinButtonCancel";
     this.skinButtonCancel.Size = new Size(0x61, 0x17);
     this.skinButtonCancel.SkinBasePath = @"Controls\Button\Round Edge";
     base.ttDefault.SetSuperTip(this.skinButtonCancel, null);
     this.skinButtonCancel.TabIndex = 0x2d;
     this.skinButtonCancel.TabStop = true;
     this.skinButtonCancel.Text = "<LOC>Cancel";
     this.skinButtonCancel.TextAlign = ContentAlignment.MiddleCenter;
     this.skinButtonCancel.TextPadding = new Padding(0);
     this.skinButtonCancel.Click += new EventHandler(this.skinButtonCancel_Click);
     this.skinButtonSearch.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
     this.skinButtonSearch.AutoStyle = true;
     this.skinButtonSearch.BackColor = Color.Black;
     this.skinButtonSearch.ButtonState = 0;
     this.skinButtonSearch.DialogResult = DialogResult.OK;
     this.skinButtonSearch.DisabledForecolor = Color.Gray;
     this.skinButtonSearch.DrawColor = Color.White;
     this.skinButtonSearch.DrawEdges = true;
     this.skinButtonSearch.FocusColor = Color.Yellow;
     this.skinButtonSearch.Font = new Font("Verdana", 8f, FontStyle.Bold);
     this.skinButtonSearch.ForeColor = Color.White;
     this.skinButtonSearch.HorizontalScalingMode = ScalingModes.Tile;
     this.skinButtonSearch.IsStyled = true;
     this.skinButtonSearch.Location = new Point(0x2ff, 0x2a2);
     this.skinButtonSearch.Name = "skinButtonSearch";
     this.skinButtonSearch.Size = new Size(0x61, 0x17);
     this.skinButtonSearch.SkinBasePath = @"Controls\Button\Round Edge";
     base.ttDefault.SetSuperTip(this.skinButtonSearch, null);
     this.skinButtonSearch.TabIndex = 0x2e;
     this.skinButtonSearch.TabStop = true;
     this.skinButtonSearch.Text = "<LOC>Start Search";
     this.skinButtonSearch.TextAlign = ContentAlignment.MiddleCenter;
     this.skinButtonSearch.TextPadding = new Padding(0);
     this.skinButtonSearch.Click += new EventHandler(this.skinButton1_Click);
     this.rbSeraphim.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
     this.rbSeraphim.BackColor = Color.Black;
     this.rbSeraphim.CheckAlign = ContentAlignment.BottomCenter;
     this.rbSeraphim.FlatStyle = FlatStyle.Flat;
     this.rbSeraphim.Image = Resources.seraphim;
     this.rbSeraphim.ImageAlign = ContentAlignment.TopCenter;
     this.rbSeraphim.Location = new Point(610, 0x1a7);
     this.rbSeraphim.Name = "rbSeraphim";
     this.rbSeraphim.Size = new Size(0xc6, 0xf5);
     base.ttDefault.SetSuperTip(this.rbSeraphim, null);
     this.rbSeraphim.TabIndex = 0x2f;
     this.rbSeraphim.Text = "Seraphim";
     this.rbSeraphim.TextAlign = ContentAlignment.BottomCenter;
     this.rbSeraphim.TextImageRelation = TextImageRelation.TextAboveImage;
     this.rbSeraphim.UseVisualStyleBackColor = false;
     this.rbSeraphim.Paint += new PaintEventHandler(this.rbRandom_Paint);
     this.rbSeraphim.CheckedChanged += new EventHandler(this.rbSeraphim_CheckedChanged);
     base.AcceptButton = this.skinButtonSearch;
     base.AutoScaleMode = AutoScaleMode.None;
     base.CancelButton = this.skinButtonCancel;
     base.ClientSize = new Size(0x400, 740);
     base.Controls.Add(this.rbSeraphim);
     base.Controls.Add(this.skinButtonSearch);
     base.Controls.Add(this.skinButtonCancel);
     base.Controls.Add(this.gpgLabel1);
     base.Controls.Add(this.lMapPrefs);
     base.Controls.Add(this.rbRandom);
     base.Controls.Add(this.rbUEF);
     base.Controls.Add(this.rbCybran);
     base.Controls.Add(this.rbAeon);
     base.Controls.Add(this.gpgMapSelectGrid);
     this.Font = new Font("Verdana", 8f);
     base.Location = new Point(0, 0);
     this.MinimumSize = new Size(0x400, 740);
     base.Name = "DlgSupcomMapOptions";
     base.ttDefault.SetSuperTip(this, null);
     this.Text = "<LOC>Ranked Match Preferences";
     base.Controls.SetChildIndex(this.gpgMapSelectGrid, 0);
     base.Controls.SetChildIndex(this.rbAeon, 0);
     base.Controls.SetChildIndex(this.rbCybran, 0);
     base.Controls.SetChildIndex(this.rbUEF, 0);
     base.Controls.SetChildIndex(this.rbRandom, 0);
     base.Controls.SetChildIndex(this.lMapPrefs, 0);
     base.Controls.SetChildIndex(this.gpgLabel1, 0);
     base.Controls.SetChildIndex(this.skinButtonCancel, 0);
     base.Controls.SetChildIndex(this.skinButtonSearch, 0);
     base.Controls.SetChildIndex(this.rbSeraphim, 0);
     ((ISupportInitialize) base.pbBottom).EndInit();
     this.gpgMapSelectGrid.EndInit();
     this.cardView1.EndInit();
     this.riPriority.EndInit();
     this.riMap.EndInit();
     this.rimPictureEdit3.EndInit();
     this.rimTextEdit.EndInit();
     this.rimMemoEdit3.EndInit();
     this.riPopup.EndInit();
     this.repositoryItemTimeEdit1.EndInit();
     this.repositoryItemTextEdit1.EndInit();
     this.riPictureStatus.EndInit();
     this.riButtonStatus.EndInit();
     this.riTextPriority.EndInit();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
예제 #44
0
        public void ShowTableViewWithListEnumType()
        {
            //demonstrates how easy it is to add custom editor to tableview for bindinglist<T> :)
            //In this case (BindingList<T> you don't need 
            //a typeconverter or comboboxhelper :)
            var tableView = new TableView();
            var list = new BindingList<ClassWithEnum> { new ClassWithEnum { Type = FruitType.Appel } };
            tableView.Data = list;


            var comboBox = new RepositoryItemImageComboBox();
            comboBox.Items.AddEnum(typeof(FruitType));

            tableView.SetColumnEditor(comboBox, 0);
            WindowsFormsTestHelper.ShowModal(tableView);
        }
예제 #45
0
파일: Helpers.cs 프로젝트: shine8319/DLS
 public static void InitPersonComboBox(RepositoryItemImageComboBox edit) {
     ImageCollection iCollection = new ImageCollection();
     iCollection.AddImage(Properties.Resources.Mr);
     iCollection.AddImage(Properties.Resources.Ms);
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.Male, ContactGender.Male, 0));
     edit.Items.Add(new ImageComboBoxItem(Properties.Resources.Female, ContactGender.Female, 1));
     edit.SmallImages = iCollection;
 }
예제 #46
0
 public static void Populate(RepositoryItemImageComboBox comboBox, Type enumType, params System.Enum[] excludeValues)
 {
     Populate(comboBox.Items, enumType, excludeValues);
 }
예제 #47
0
파일: Helpers.cs 프로젝트: shine8319/DLS
 public static RepositoryItemImageComboBox CreateTaskStatusImageComboBox(RepositoryItemImageComboBox edit) {
     Array arr = Enum.GetValues(typeof(TaskStatus));
     edit.Items.Clear();
     foreach(TaskStatus status in arr)
         edit.Items.Add(new ImageComboBoxItem(GetStringByTaskStatus(status), status, (int)status));
     return edit;
 }
 private RepositoryItemImageComboBox CotImageTaiNguyen(
     GridColumn colNhomTaiNguyen, string fieldName)
 {
     ImageCollection images = new ImageCollection();
     images.AddImage(ResourceMan.getImage48("DM_KhachHang.png"));
     images.AddImage(ResourceMan.getImage48("DM_NhaCungCap.png"));
     images.AddImage(ResourceMan.getImage48("DM_KhachHang_NhaCungCap.png"));
     RepositoryItemImageComboBox icb = new RepositoryItemImageComboBox();
     icb.LargeImages = images;
     icb.Items.AddRange(new object[]{
         new ImageComboBoxItem((Int64)1,0),
         new ImageComboBoxItem((Int64)2,1),
         new ImageComboBoxItem((Int64)3,2)
     });
     icb.GlyphAlignment = HorzAlignment.Center;
     colNhomTaiNguyen.ColumnEdit = icb;
     colNhomTaiNguyen.Width = 20;
     colNhomTaiNguyen.OptionsColumn.FixedWidth = true;
     colNhomTaiNguyen.OptionsColumn.AllowEdit = false;
     colNhomTaiNguyen.OptionsColumn.AllowSize = false;
     colNhomTaiNguyen.FieldName = fieldName;
     colNhomTaiNguyen.OptionsColumn.ShowCaption = false;
     colNhomTaiNguyen.OptionsFilter.AllowFilter = false;
     colNhomTaiNguyen.OptionsFilter.AllowAutoFilter = false;
     colNhomTaiNguyen.Caption = ".";
     colNhomTaiNguyen.OptionsColumn.AllowFocus = false;
     return icb;
 }