protected override RepositoryItem OnCreateRepositoryItem(Type objectType) { var edit = new RepositoryItemMemoExEdit(); WinFormPublic.AddClearButton(edit); return(edit); }
public void AddMemoExEdit(string string_2, object object_0, bool bool_0) { this.repositoryItemMemoExEdit_0 = new RepositoryItemMemoExEdit(); this.gridEditorCollection_0.Add(this.repositoryItemMemoExEdit_0, string_2, object_0); this.repositoryItemMemoExEdit_0.AutoHeight = false; this.repositoryItemMemoExEdit_0.BorderStyle = BorderStyles.NoBorder; this.repositoryItemMemoExEdit_0.Name = "repositoryItemMemoExEdit"; this.repositoryItemMemoExEdit_0.PopupStartSize = new Size(250, 150); this.repositoryItemMemoExEdit_0.ReadOnly = bool_0; }
public static RepositoryItemMemoExEdit CreateTreeMemoExEdit(this TreeListColumn treeColumn) { RepositoryItemMemoExEdit repositoryItem = new RepositoryItemMemoExEdit { AutoHeight = false, ShowIcon = false, PopupFormSize = new Size(400, 200) }; treeColumn.TreeList.RepositoryItems.Add(repositoryItem); treeColumn.ColumnEdit = repositoryItem; return(repositoryItem); }
/// <summary> /// 创建GridView的列编辑为MemoExEdit /// </summary> /// <param name="gridColumn">GridColumn列对象</param> /// <returns></returns> public static RepositoryItemMemoExEdit CreateMemoExEdit(this GridColumn gridColumn) { RepositoryItemMemoExEdit repositoryItem = new RepositoryItemMemoExEdit { AutoHeight = false, ShowIcon = false, PopupFormSize = new Size(400, 200) }; gridColumn.View.GridControl.RepositoryItems.Add(repositoryItem); gridColumn.ColumnEdit = repositoryItem; return(repositoryItem); }
protected virtual void ShowForm(Control browser) { if (browser == null) { throw new Exception("Browser == null"); } browser.Dock = DockStyle.Fill; Form = new XtraForm(); Form.StartPosition = FormStartPosition.CenterScreen; Form.Size = new Size((int)(DpiProvider.Default.DpiScaleFactor * 1000), (int)(DpiProvider.Default.DpiScaleFactor * 800)); Form.Controls.Add(browser); Form.Shown += Form_Shown; Form.TopMost = true; BarManager manager = new BarManager(); manager.Form = Form; Bar bar = new Bar(manager); bar.OptionsBar.UseWholeRow = true; bar.OptionsBar.DrawBorder = false; bar.DockStyle = BarDockStyle.Top; manager.ForceInitialize(); RepositoryItemMemoExEdit edit = new RepositoryItemMemoExEdit(); edit.Buttons.Add(new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Search)); edit.Tag = manager; edit.ButtonClick += OnExecuteScriptButtonClick; manager.RepositoryItems.Add(edit); BarEditItem item = new BarEditItem(manager); item.EditWidth = 200; item.Edit = edit; bar.ItemLinks.Add(item); Form.Show(); }
private void InitializeComponent() { this.components = (IContainer) new Container(); ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(SelectVarsForm)); this.panel1 = new Panel(); this.cmdCancel = new Button(); this.cmdRefresh = new Button(); this.cmdSelect = new Button(); this.gridControlSetting = new GridControl(); this.ds = new DataSet(); this.table_settinggroup = new DataTable(); this.dataColumn10 = new DataColumn(); this.dataColumn11 = new DataColumn(); this.dataColumn12 = new DataColumn(); this.dataColumn13 = new DataColumn(); this.dataColumn14 = new DataColumn(); this.dataColumn15 = new DataColumn(); this.table_setting = new DataTable(); this.dataColumn1 = new DataColumn(); this.dataColumn2 = new DataColumn(); this.dataColumn3 = new DataColumn(); this.dataColumn4 = new DataColumn(); this.dataColumn5 = new DataColumn(); this.dataColumn6 = new DataColumn(); this.dataColumn7 = new DataColumn(); this.dataColumn8 = new DataColumn(); this.dataColumn16 = new DataColumn(); this.dataColumn9 = new DataColumn(); this.dataColumn17 = new DataColumn(); this.dataColumn18 = new DataColumn(); this.dataColumn19 = new DataColumn(); this.gridViewSetting = new GridView(); this.colidsetting = new GridColumn(); this.colname = new GridColumn(); this.colintvalue = new GridColumn(); this.repositoryItemTextEdit1 = new AtRepositoryItemTextEdit(); this.colintvalue2 = new GridColumn(); this.colstrvalue = new GridColumn(); this.coltxtvalue = new GridColumn(); this.colcomment = new GridColumn(); this.colgroupname = new GridColumn(); this.coldtvalue = new GridColumn(); this.repositoryItemDateEdit1 = new RepositoryItemDateEdit(); this.repositoryItemMemoExEdit1 = new RepositoryItemMemoExEdit(); this.repositoryItemImageEdit1 = new RepositoryItemImageEdit(); this.treeList1 = new TreeList(); this.treeListColumn1 = new TreeListColumn(); this.imageList1 = new ImageList(this.components); this.splitterControl1 = new SplitterControl(); this.panel1.SuspendLayout(); this.gridControlSetting.BeginInit(); this.ds.BeginInit(); this.table_settinggroup.BeginInit(); this.table_setting.BeginInit(); this.gridViewSetting.BeginInit(); this.repositoryItemTextEdit1.BeginInit(); this.repositoryItemDateEdit1.BeginInit(); this.repositoryItemDateEdit1.VistaTimeProperties.BeginInit(); this.repositoryItemMemoExEdit1.BeginInit(); this.repositoryItemImageEdit1.BeginInit(); this.treeList1.BeginInit(); this.SuspendLayout(); this.panel1.Controls.Add((Control)this.cmdCancel); this.panel1.Controls.Add((Control)this.cmdRefresh); this.panel1.Controls.Add((Control)this.cmdSelect); this.panel1.Dock = DockStyle.Bottom; this.panel1.Location = new Point(0, 333); this.panel1.Name = "panel1"; this.panel1.Size = new Size(705, 33); this.panel1.TabIndex = 2; this.cmdCancel.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdCancel.FlatStyle = FlatStyle.Flat; this.cmdCancel.Location = new Point(618, 5); this.cmdCancel.Name = "cmdCancel"; this.cmdCancel.Size = new Size(75, 23); this.cmdCancel.TabIndex = 2; this.cmdCancel.Text = "Закрыть"; this.cmdCancel.Click += new EventHandler(this.cmdCancel_Click); this.cmdRefresh.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdRefresh.FlatStyle = FlatStyle.Flat; this.cmdRefresh.Location = new Point(537, 5); this.cmdRefresh.Name = "cmdRefresh"; this.cmdRefresh.Size = new Size(75, 23); this.cmdRefresh.TabIndex = 1; this.cmdRefresh.Text = "Обновить"; this.cmdRefresh.Click += new EventHandler(this.cmdRefresh_Click); this.cmdSelect.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdSelect.FlatStyle = FlatStyle.Flat; this.cmdSelect.Location = new Point(456, 5); this.cmdSelect.Name = "cmdSelect"; this.cmdSelect.Size = new Size(75, 23); this.cmdSelect.TabIndex = 0; this.cmdSelect.Text = "Выбрать"; this.cmdSelect.Click += new EventHandler(this.cmdSelect_Click); this.gridControlSetting.DataMember = "settinggroup.FK_setting_settinggroup"; this.gridControlSetting.DataSource = (object)this.ds; this.gridControlSetting.Dock = DockStyle.Fill; this.gridControlSetting.EmbeddedNavigator.Name = ""; this.gridControlSetting.Location = new Point(246, 0); this.gridControlSetting.LookAndFeel.Style = LookAndFeelStyle.Flat; this.gridControlSetting.LookAndFeel.UseDefaultLookAndFeel = false; this.gridControlSetting.MainView = (BaseView)this.gridViewSetting; this.gridControlSetting.Name = "gridControlSetting"; this.gridControlSetting.RepositoryItems.AddRange(new RepositoryItem[4] { (RepositoryItem)this.repositoryItemTextEdit1, (RepositoryItem)this.repositoryItemMemoExEdit1, (RepositoryItem)this.repositoryItemImageEdit1, (RepositoryItem)this.repositoryItemDateEdit1 }); this.gridControlSetting.Size = new Size(459, 333); this.gridControlSetting.TabIndex = 4; this.gridControlSetting.ViewCollection.AddRange(new BaseView[1] { (BaseView)this.gridViewSetting }); this.ds.DataSetName = "ds_setting"; this.ds.EnforceConstraints = false; this.ds.Relations.AddRange(new DataRelation[1] { new DataRelation("FK_setting_settinggroup", "settinggroup", "setting", new string[1] { "idsettinggroup" }, new string[1] { "idsettinggroup" }, 0 != 0) }); this.ds.Tables.AddRange(new DataTable[2] { this.table_settinggroup, this.table_setting }); this.table_settinggroup.Columns.AddRange(new DataColumn[6] { this.dataColumn10, this.dataColumn11, this.dataColumn12, this.dataColumn13, this.dataColumn14, this.dataColumn15 }); this.table_settinggroup.Constraints.AddRange(new Constraint[1] { (Constraint) new UniqueConstraint("Constraint1", new string[1] { "idsettinggroup" }, 1 != 0) }); this.table_settinggroup.PrimaryKey = new DataColumn[1] { this.dataColumn10 }; this.table_settinggroup.TableName = "settinggroup"; this.dataColumn10.AllowDBNull = false; this.dataColumn10.ColumnName = "idsettinggroup"; this.dataColumn10.DataType = typeof(int); this.dataColumn11.ColumnName = "name"; this.dataColumn12.ColumnName = "comment"; this.dataColumn13.ColumnName = "isactive"; this.dataColumn13.DataType = typeof(bool); this.dataColumn14.ColumnName = "parentid"; this.dataColumn14.DataType = typeof(int); this.dataColumn15.ColumnName = "_image"; this.dataColumn15.DataType = typeof(int); this.dataColumn15.DefaultValue = (object)0; this.table_setting.Columns.AddRange(new DataColumn[13] { this.dataColumn1, this.dataColumn2, this.dataColumn3, this.dataColumn4, this.dataColumn5, this.dataColumn6, this.dataColumn7, this.dataColumn8, this.dataColumn16, this.dataColumn9, this.dataColumn17, this.dataColumn18, this.dataColumn19 }); this.table_setting.Constraints.AddRange(new Constraint[2] { (Constraint) new UniqueConstraint("Constraint1", new string[1] { "idsetting" }, 1 != 0), (Constraint) new ForeignKeyConstraint("Relation1", "settinggroup", new string[1] { "idsettinggroup" }, new string[1] { "idsettinggroup" }, AcceptRejectRule.None, Rule.Cascade, Rule.Cascade) }); this.table_setting.PrimaryKey = new DataColumn[1] { this.dataColumn1 }; this.table_setting.TableName = "setting"; this.dataColumn1.AllowDBNull = false; this.dataColumn1.ColumnName = "idsetting"; this.dataColumn1.DataType = typeof(int); this.dataColumn2.ColumnName = "name"; this.dataColumn3.ColumnName = "intvalue"; this.dataColumn3.DataType = typeof(double); this.dataColumn4.ColumnName = "strvalue"; this.dataColumn5.ColumnName = "comment"; this.dataColumn6.ColumnName = "txtvalue"; this.dataColumn7.ColumnName = "blbvalue"; this.dataColumn7.DataType = typeof(byte[]); this.dataColumn8.ColumnName = "groupname"; this.dataColumn16.ColumnName = "idsettinggroup"; this.dataColumn16.DataType = typeof(int); this.dataColumn9.ColumnName = "dtvalue"; this.dataColumn9.DataType = typeof(DateTime); this.dataColumn17.ColumnName = "addorder"; this.dataColumn17.DataType = typeof(bool); this.dataColumn18.ColumnName = "addmodel"; this.dataColumn18.DataType = typeof(bool); this.dataColumn19.ColumnName = "intvalue2"; this.dataColumn19.DataType = typeof(double); this.gridViewSetting.Appearance.FocusedRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewSetting.Appearance.FocusedRow.BackColor2 = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewSetting.Appearance.FocusedRow.BorderColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewSetting.Appearance.FocusedRow.ForeColor = Color.Black; this.gridViewSetting.Appearance.FocusedRow.Options.UseBackColor = true; this.gridViewSetting.Appearance.FocusedRow.Options.UseBorderColor = true; this.gridViewSetting.Appearance.FocusedRow.Options.UseForeColor = true; this.gridViewSetting.Appearance.GroupPanel.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewSetting.Appearance.GroupPanel.BackColor2 = Color.FromArgb(192, 192, (int)byte.MaxValue); this.gridViewSetting.Appearance.GroupPanel.Options.UseBackColor = true; this.gridViewSetting.Appearance.HideSelectionRow.BackColor = Color.FromArgb(192, 192, (int)byte.MaxValue); this.gridViewSetting.Appearance.HideSelectionRow.BackColor2 = Color.FromArgb(192, 192, (int)byte.MaxValue); this.gridViewSetting.Appearance.HideSelectionRow.BorderColor = Color.FromArgb(192, 192, (int)byte.MaxValue); this.gridViewSetting.Appearance.HideSelectionRow.ForeColor = Color.Black; this.gridViewSetting.Appearance.HideSelectionRow.Options.UseBackColor = true; this.gridViewSetting.Appearance.HideSelectionRow.Options.UseBorderColor = true; this.gridViewSetting.Appearance.HideSelectionRow.Options.UseForeColor = true; this.gridViewSetting.Appearance.SelectedRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewSetting.Appearance.SelectedRow.BackColor2 = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewSetting.Appearance.SelectedRow.BorderColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewSetting.Appearance.SelectedRow.ForeColor = Color.Black; this.gridViewSetting.Appearance.SelectedRow.Options.UseBackColor = true; this.gridViewSetting.Appearance.SelectedRow.Options.UseBorderColor = true; this.gridViewSetting.Appearance.SelectedRow.Options.UseForeColor = true; this.gridViewSetting.BorderStyle = BorderStyles.Simple; this.gridViewSetting.Columns.AddRange(new GridColumn[9] { this.colidsetting, this.colname, this.colintvalue, this.colintvalue2, this.colstrvalue, this.coltxtvalue, this.colcomment, this.colgroupname, this.coldtvalue }); this.gridViewSetting.GridControl = this.gridControlSetting; this.gridViewSetting.GroupPanelText = "Панель группировки"; this.gridViewSetting.Name = "gridViewSetting"; this.gridViewSetting.OptionsBehavior.AllowIncrementalSearch = true; this.gridViewSetting.OptionsBehavior.Editable = false; this.gridViewSetting.OptionsCustomization.AllowFilter = false; this.gridViewSetting.OptionsDetail.ShowDetailTabs = false; this.gridViewSetting.OptionsSelection.MultiSelect = true; this.gridViewSetting.OptionsView.ShowFilterPanelMode = ShowFilterPanelMode.Never; this.gridViewSetting.OptionsView.ShowIndicator = false; this.colidsetting.Caption = "#"; this.colidsetting.FieldName = "idsetting"; this.colidsetting.Name = "colidsetting"; this.colidsetting.OptionsColumn.AllowEdit = false; this.colidsetting.Visible = true; this.colidsetting.VisibleIndex = 0; this.colidsetting.Width = 31; this.colname.Caption = "Имя"; this.colname.FieldName = "name"; this.colname.Name = "colname"; this.colname.Visible = true; this.colname.VisibleIndex = 1; this.colname.Width = 36; this.colintvalue.Caption = "Число 1"; this.colintvalue.ColumnEdit = (RepositoryItem)this.repositoryItemTextEdit1; this.colintvalue.FieldName = "intvalue"; this.colintvalue.Name = "colintvalue"; this.colintvalue.Visible = true; this.colintvalue.VisibleIndex = 2; this.colintvalue.Width = 54; this.repositoryItemTextEdit1.AutoHeight = false; this.repositoryItemTextEdit1.DisplayFormat.FormatString = "n6"; this.repositoryItemTextEdit1.DisplayFormat.FormatType = FormatType.Numeric; this.repositoryItemTextEdit1.EditFormat.FormatString = "n6"; this.repositoryItemTextEdit1.EditFormat.FormatType = FormatType.Numeric; this.repositoryItemTextEdit1.Mask.EditMask = "n6"; this.repositoryItemTextEdit1.Mask.MaskType = MaskType.Numeric; this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1"; this.colintvalue2.Caption = "Число 2"; this.colintvalue2.FieldName = "intvalue2"; this.colintvalue2.Name = "colintvalue2"; this.colintvalue2.Visible = true; this.colintvalue2.VisibleIndex = 3; this.colintvalue2.Width = 44; this.colstrvalue.Caption = "Строка"; this.colstrvalue.FieldName = "strvalue"; this.colstrvalue.Name = "colstrvalue"; this.colstrvalue.Visible = true; this.colstrvalue.VisibleIndex = 4; this.colstrvalue.Width = 31; this.coltxtvalue.Caption = "Текст"; this.coltxtvalue.FieldName = "txtvalue"; this.coltxtvalue.Name = "coltxtvalue"; this.coltxtvalue.Visible = true; this.coltxtvalue.VisibleIndex = 5; this.coltxtvalue.Width = 31; this.colcomment.Caption = "Описание"; this.colcomment.FieldName = "comment"; this.colcomment.Name = "colcomment"; this.colcomment.Visible = true; this.colcomment.VisibleIndex = 6; this.colcomment.Width = 31; this.colgroupname.Caption = "Группа"; this.colgroupname.FieldName = "groupname"; this.colgroupname.Name = "colgroupname"; this.colgroupname.Visible = true; this.colgroupname.VisibleIndex = 7; this.colgroupname.Width = 31; this.coldtvalue.Caption = "Дата"; this.coldtvalue.ColumnEdit = (RepositoryItem)this.repositoryItemDateEdit1; this.coldtvalue.FieldName = "dtvalue"; this.coldtvalue.Name = "coldtvalue"; this.coldtvalue.Visible = true; this.coldtvalue.VisibleIndex = 8; this.coldtvalue.Width = 31; this.repositoryItemDateEdit1.AutoHeight = false; this.repositoryItemDateEdit1.Buttons.AddRange(new EditorButton[1] { new EditorButton(ButtonPredefines.Combo) }); this.repositoryItemDateEdit1.Name = "repositoryItemDateEdit1"; this.repositoryItemDateEdit1.VistaTimeProperties.Buttons.AddRange(new EditorButton[1] { new EditorButton() }); this.repositoryItemMemoExEdit1.AutoHeight = false; this.repositoryItemMemoExEdit1.Buttons.AddRange(new EditorButton[1] { new EditorButton(ButtonPredefines.Combo) }); this.repositoryItemMemoExEdit1.Name = "repositoryItemMemoExEdit1"; this.repositoryItemImageEdit1.AutoHeight = false; this.repositoryItemImageEdit1.Buttons.AddRange(new EditorButton[1] { new EditorButton(ButtonPredefines.Combo) }); this.repositoryItemImageEdit1.Name = "repositoryItemImageEdit1"; this.treeList1.Appearance.FocusedCell.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeList1.Appearance.FocusedCell.ForeColor = Color.Black; this.treeList1.Appearance.FocusedCell.Options.UseBackColor = true; this.treeList1.Appearance.FocusedCell.Options.UseForeColor = true; this.treeList1.Appearance.FocusedRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeList1.Appearance.FocusedRow.ForeColor = Color.Black; this.treeList1.Appearance.FocusedRow.Options.UseBackColor = true; this.treeList1.Appearance.FocusedRow.Options.UseForeColor = true; this.treeList1.Appearance.HideSelectionRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeList1.Appearance.HideSelectionRow.BackColor2 = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeList1.Appearance.HideSelectionRow.ForeColor = Color.Black; this.treeList1.Appearance.HideSelectionRow.Options.UseBackColor = true; this.treeList1.Appearance.HideSelectionRow.Options.UseForeColor = true; this.treeList1.Appearance.SelectedRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeList1.Appearance.SelectedRow.ForeColor = Color.Black; this.treeList1.Appearance.SelectedRow.Options.UseBackColor = true; this.treeList1.Appearance.SelectedRow.Options.UseForeColor = true; this.treeList1.BorderStyle = BorderStyles.Simple; this.treeList1.Columns.AddRange(new TreeListColumn[1] { this.treeListColumn1 }); this.treeList1.DataMember = "settinggroup"; this.treeList1.DataSource = (object)this.ds; this.treeList1.Dock = DockStyle.Left; this.treeList1.HorzScrollVisibility = DevExpress.XtraTreeList.ScrollVisibility.Never; this.treeList1.ImageIndexFieldName = "_image"; this.treeList1.KeyFieldName = "idsettinggroup"; this.treeList1.Location = new Point(0, 0); this.treeList1.LookAndFeel.Style = LookAndFeelStyle.Flat; this.treeList1.LookAndFeel.UseDefaultLookAndFeel = false; this.treeList1.Name = "treeList1"; this.treeList1.OptionsView.ShowHorzLines = false; this.treeList1.OptionsView.ShowIndicator = false; this.treeList1.OptionsView.ShowVertLines = false; this.treeList1.ParentFieldName = "parentid"; this.treeList1.SelectImageList = (object)this.imageList1; this.treeList1.Size = new Size(240, 333); this.treeList1.TabIndex = 5; this.treeListColumn1.Caption = "Группы переменных"; this.treeListColumn1.FieldName = "name"; this.treeListColumn1.MinWidth = 28; this.treeListColumn1.Name = "treeListColumn1"; this.treeListColumn1.OptionsColumn.AllowEdit = false; this.treeListColumn1.Visible = true; this.treeListColumn1.VisibleIndex = 0; this.treeListColumn1.Width = 167; this.imageList1.ImageStream = (ImageListStreamer)componentResourceManager.GetObject("imageList1.ImageStream"); this.imageList1.TransparentColor = Color.Magenta; this.imageList1.Images.SetKeyName(0, "Folder.ico"); this.splitterControl1.Location = new Point(240, 0); this.splitterControl1.Name = "splitterControl1"; this.splitterControl1.Size = new Size(6, 333); this.splitterControl1.TabIndex = 6; this.splitterControl1.TabStop = false; this.AutoScaleDimensions = new SizeF(6f, 13f); this.AutoScaleMode = AutoScaleMode.Font; this.Controls.Add((Control)this.gridControlSetting); this.Controls.Add((Control)this.splitterControl1); this.Controls.Add((Control)this.treeList1); this.Controls.Add((Control)this.panel1); this.Name = "SelectVarsForm"; this.Size = new Size(705, 366); this.Text = "Переменные"; this.panel1.ResumeLayout(false); this.gridControlSetting.EndInit(); this.ds.EndInit(); this.table_settinggroup.EndInit(); this.table_setting.EndInit(); this.gridViewSetting.EndInit(); this.repositoryItemTextEdit1.EndInit(); this.repositoryItemDateEdit1.VistaTimeProperties.EndInit(); this.repositoryItemDateEdit1.EndInit(); this.repositoryItemMemoExEdit1.EndInit(); this.repositoryItemImageEdit1.EndInit(); this.treeList1.EndInit(); this.ResumeLayout(false); }
private void InitializeComponent() { this.components = (IContainer) new Container(); ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(SourceInfoForm)); this.ds = new DataSet(); this.table_SourceInfogroup = new DataTable(); this.dataColumn1 = new DataColumn(); this.dataColumn2 = new DataColumn(); this.dataColumn3 = new DataColumn(); this.dataColumn4 = new DataColumn(); this.colisactive = new DataColumn(); this.dataColumn9 = new DataColumn(); this.table_SourceInfo = new DataTable(); this.dataColumn5 = new DataColumn(); this.dataColumn6 = new DataColumn(); this.dataColumn7 = new DataColumn(); this.dataColumn8 = new DataColumn(); this.panelDialog = new Panel(); this.cmdCancel = new Button(); this.cmdOk = new Button(); this.panelEdit = new Panel(); this.cmdClose = new Button(); this.cmdReLoad = new Button(); this.cmdSave = new Button(); this.gridControlSourceInfo = new GridControl(); this.MenuItem = new ContextMenuStrip(this.components); this.MenuItemAdd = new ToolStripMenuItem(); this.toolStripSeparator1 = new ToolStripSeparator(); this.MenuItemRemove = new ToolStripMenuItem(); this.toolStripSeparator2 = new ToolStripSeparator(); this.MenuItemMove = new ToolStripMenuItem(); this.gridViewItem = new GridView(); this.colidSourceInfo = new GridColumn(); this.colname = new GridColumn(); this.colcomment = new GridColumn(); this.repositoryItemMemoExEdit1 = new RepositoryItemMemoExEdit(); this.repositoryItemPictureEdit1 = new RepositoryItemPictureEdit(); this.repositoryItemCheckEdit1 = new RepositoryItemCheckEdit(); this.repositoryItemCheckEdit2 = new RepositoryItemCheckEdit(); this.splitterControl1 = new SplitterControl(); this.treeListGroup = new TreeList(); this.treeListColumn1 = new TreeListColumn(); this.treeListColumn2 = new TreeListColumn(); this.MenuGroup = new ContextMenuStrip(this.components); this.MenuGroupAddMain = new ToolStripMenuItem(); this.MenuGroupAddChild = new ToolStripMenuItem(); this.MenuGroupRename = new ToolStripMenuItem(); this.toolStripSeparator4 = new ToolStripSeparator(); this.MenuGroupRemove = new ToolStripMenuItem(); this.toolStripSeparator8 = new ToolStripSeparator(); this.MenuGroupMove = new ToolStripMenuItem(); this.MenuGroupSetMain = new ToolStripMenuItem(); this.imageList1 = new ImageList(this.components); this.ds.BeginInit(); this.table_SourceInfogroup.BeginInit(); this.table_SourceInfo.BeginInit(); this.panelDialog.SuspendLayout(); this.panelEdit.SuspendLayout(); this.gridControlSourceInfo.BeginInit(); this.MenuItem.SuspendLayout(); this.gridViewItem.BeginInit(); this.repositoryItemMemoExEdit1.BeginInit(); this.repositoryItemPictureEdit1.BeginInit(); this.repositoryItemCheckEdit1.BeginInit(); this.repositoryItemCheckEdit2.BeginInit(); this.treeListGroup.BeginInit(); this.MenuGroup.SuspendLayout(); this.SuspendLayout(); this.ds.DataSetName = "NewDataSet"; this.ds.Relations.AddRange(new DataRelation[2] { new DataRelation("FK_SourceInfogroup_SourceInfogroup", "SourceInfogroup", "SourceInfogroup", new string[1] { "idSourceInfogroup" }, new string[1] { "parentid" }, 0 != 0), new DataRelation("FK_SourceInfogroup_SourceInfo", "SourceInfogroup", "SourceInfo", new string[1] { "idSourceInfogroup" }, new string[1] { "idSourceInfogroup" }, 0 != 0) }); this.ds.Tables.AddRange(new DataTable[2] { this.table_SourceInfogroup, this.table_SourceInfo }); this.table_SourceInfogroup.Columns.AddRange(new DataColumn[6] { this.dataColumn1, this.dataColumn2, this.dataColumn3, this.dataColumn4, this.colisactive, this.dataColumn9 }); this.table_SourceInfogroup.Constraints.AddRange(new Constraint[2] { (Constraint) new UniqueConstraint("Constraint1", new string[1] { "idSourceInfogroup" }, 1 != 0), (Constraint) new ForeignKeyConstraint("FK_SourceInfogroup_SourceInfogroup", "SourceInfogroup", new string[1] { "idSourceInfogroup" }, new string[1] { "parentid" }, AcceptRejectRule.None, Rule.Cascade, Rule.Cascade) }); this.table_SourceInfogroup.PrimaryKey = new DataColumn[1] { this.dataColumn1 }; this.table_SourceInfogroup.TableName = "SourceInfogroup"; this.dataColumn1.AllowDBNull = false; this.dataColumn1.ColumnName = "idSourceInfogroup"; this.dataColumn1.DataType = typeof(int); this.dataColumn2.ColumnName = "parentid"; this.dataColumn2.DataType = typeof(int); this.dataColumn3.ColumnName = "name"; this.dataColumn4.ColumnName = "comment"; this.colisactive.ColumnName = "isactive"; this.colisactive.DataType = typeof(bool); this.colisactive.DefaultValue = (object)false; this.dataColumn9.ColumnName = "_imageindex"; this.dataColumn9.DataType = typeof(short); this.table_SourceInfo.Columns.AddRange(new DataColumn[4] { this.dataColumn5, this.dataColumn6, this.dataColumn7, this.dataColumn8 }); this.table_SourceInfo.Constraints.AddRange(new Constraint[2] { (Constraint) new UniqueConstraint("Constraint1", new string[1] { "idSourceInfo" }, 1 != 0), (Constraint) new ForeignKeyConstraint("FK_SourceInfogroup_SourceInfogroup", "SourceInfogroup", new string[1] { "idSourceInfogroup" }, new string[1] { "idSourceInfogroup" }, AcceptRejectRule.None, Rule.Cascade, Rule.Cascade) }); this.table_SourceInfo.PrimaryKey = new DataColumn[1] { this.dataColumn5 }; this.table_SourceInfo.TableName = "SourceInfo"; this.dataColumn5.AllowDBNull = false; this.dataColumn5.ColumnName = "idSourceInfo"; this.dataColumn5.DataType = typeof(int); this.dataColumn6.ColumnName = "idSourceInfogroup"; this.dataColumn6.DataType = typeof(int); this.dataColumn7.ColumnName = "name"; this.dataColumn8.ColumnName = "comment"; this.panelDialog.Controls.Add((Control)this.cmdCancel); this.panelDialog.Controls.Add((Control)this.cmdOk); this.panelDialog.Dock = DockStyle.Bottom; this.panelDialog.Location = new Point(0, 250); this.panelDialog.Name = "panelDialog"; this.panelDialog.Size = new Size(598, 33); this.panelDialog.TabIndex = 5; this.panelDialog.Visible = false; this.cmdCancel.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdCancel.DialogResult = DialogResult.Cancel; this.cmdCancel.FlatStyle = FlatStyle.Flat; this.cmdCancel.Location = new Point(511, 5); this.cmdCancel.Name = "cmdCancel"; this.cmdCancel.Size = new Size(75, 23); this.cmdCancel.TabIndex = 2; this.cmdCancel.Text = "Отменить"; this.cmdOk.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdOk.DialogResult = DialogResult.OK; this.cmdOk.FlatStyle = FlatStyle.Flat; this.cmdOk.Location = new Point(430, 5); this.cmdOk.Name = "cmdOk"; this.cmdOk.Size = new Size(75, 23); this.cmdOk.TabIndex = 1; this.cmdOk.Text = "Выбрать"; this.panelEdit.Controls.Add((Control)this.cmdClose); this.panelEdit.Controls.Add((Control)this.cmdReLoad); this.panelEdit.Controls.Add((Control)this.cmdSave); this.panelEdit.Dock = DockStyle.Bottom; this.panelEdit.Location = new Point(0, 283); this.panelEdit.Name = "panelEdit"; this.panelEdit.Size = new Size(598, 33); this.panelEdit.TabIndex = 4; this.cmdClose.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdClose.FlatStyle = FlatStyle.Flat; this.cmdClose.Location = new Point(511, 5); this.cmdClose.Name = "cmdClose"; this.cmdClose.Size = new Size(75, 23); this.cmdClose.TabIndex = 2; this.cmdClose.Text = "Закрыть"; this.cmdReLoad.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdReLoad.FlatStyle = FlatStyle.Flat; this.cmdReLoad.Location = new Point(430, 5); this.cmdReLoad.Name = "cmdReLoad"; this.cmdReLoad.Size = new Size(75, 23); this.cmdReLoad.TabIndex = 1; this.cmdReLoad.Text = "Отменить"; this.cmdSave.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdSave.FlatStyle = FlatStyle.Flat; this.cmdSave.Location = new Point(349, 5); this.cmdSave.Name = "cmdSave"; this.cmdSave.Size = new Size(75, 23); this.cmdSave.TabIndex = 0; this.cmdSave.Text = "Применить"; this.gridControlSourceInfo.ContextMenuStrip = this.MenuItem; this.gridControlSourceInfo.DataMember = "SourceInfogroup.FK_SourceInfogroup_SourceInfo"; this.gridControlSourceInfo.DataSource = (object)this.ds; this.gridControlSourceInfo.Dock = DockStyle.Fill; this.gridControlSourceInfo.EmbeddedNavigator.Name = ""; this.gridControlSourceInfo.Location = new Point(212, 0); this.gridControlSourceInfo.LookAndFeel.Style = LookAndFeelStyle.Flat; this.gridControlSourceInfo.LookAndFeel.UseDefaultLookAndFeel = false; this.gridControlSourceInfo.MainView = (BaseView)this.gridViewItem; this.gridControlSourceInfo.Name = "gridControlSourceInfo"; this.gridControlSourceInfo.RepositoryItems.AddRange(new RepositoryItem[4] { (RepositoryItem)this.repositoryItemMemoExEdit1, (RepositoryItem)this.repositoryItemPictureEdit1, (RepositoryItem)this.repositoryItemCheckEdit1, (RepositoryItem)this.repositoryItemCheckEdit2 }); this.gridControlSourceInfo.Size = new Size(386, 250); this.gridControlSourceInfo.TabIndex = 7; this.gridControlSourceInfo.ViewCollection.AddRange(new BaseView[1] { (BaseView)this.gridViewItem }); this.MenuItem.Items.AddRange(new ToolStripItem[5] { (ToolStripItem)this.MenuItemAdd, (ToolStripItem)this.toolStripSeparator1, (ToolStripItem)this.MenuItemRemove, (ToolStripItem)this.toolStripSeparator2, (ToolStripItem)this.MenuItemMove }); this.MenuItem.Name = "MenuItem"; this.MenuItem.Size = new Size(207, 82); this.MenuItemAdd.Name = "MenuItemAdd"; this.MenuItemAdd.ShortcutKeys = Keys.Insert | Keys.Control; this.MenuItemAdd.Size = new Size(206, 22); this.MenuItemAdd.Text = "Добавить"; this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new Size(203, 6); this.MenuItemRemove.Name = "MenuItemRemove"; this.MenuItemRemove.ShortcutKeys = Keys.Delete | Keys.Control; this.MenuItemRemove.Size = new Size(206, 22); this.MenuItemRemove.Text = "Удалить"; this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new Size(203, 6); this.MenuItemMove.Name = "MenuItemMove"; this.MenuItemMove.ShortcutKeys = Keys.F6; this.MenuItemMove.Size = new Size(206, 22); this.MenuItemMove.Text = "Переместить в группу"; this.gridViewItem.Appearance.FocusedRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.FocusedRow.BackColor2 = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.FocusedRow.BorderColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.FocusedRow.ForeColor = Color.Black; this.gridViewItem.Appearance.FocusedRow.Options.UseBackColor = true; this.gridViewItem.Appearance.FocusedRow.Options.UseBorderColor = true; this.gridViewItem.Appearance.FocusedRow.Options.UseForeColor = true; this.gridViewItem.Appearance.GroupPanel.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.GroupPanel.BackColor2 = Color.FromArgb(192, 192, (int)byte.MaxValue); this.gridViewItem.Appearance.GroupPanel.Options.UseBackColor = true; this.gridViewItem.Appearance.HideSelectionRow.BackColor = Color.FromArgb(192, 192, (int)byte.MaxValue); this.gridViewItem.Appearance.HideSelectionRow.BackColor2 = Color.FromArgb(192, 192, (int)byte.MaxValue); this.gridViewItem.Appearance.HideSelectionRow.BorderColor = Color.FromArgb(192, 192, (int)byte.MaxValue); this.gridViewItem.Appearance.HideSelectionRow.ForeColor = Color.Black; this.gridViewItem.Appearance.HideSelectionRow.Options.UseBackColor = true; this.gridViewItem.Appearance.HideSelectionRow.Options.UseBorderColor = true; this.gridViewItem.Appearance.HideSelectionRow.Options.UseForeColor = true; this.gridViewItem.Appearance.SelectedRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.SelectedRow.BackColor2 = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.SelectedRow.BorderColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.SelectedRow.ForeColor = Color.Black; this.gridViewItem.Appearance.SelectedRow.Options.UseBackColor = true; this.gridViewItem.Appearance.SelectedRow.Options.UseBorderColor = true; this.gridViewItem.Appearance.SelectedRow.Options.UseForeColor = true; this.gridViewItem.BorderStyle = BorderStyles.Simple; this.gridViewItem.Columns.AddRange(new GridColumn[3] { this.colidSourceInfo, this.colname, this.colcomment }); this.gridViewItem.GridControl = this.gridControlSourceInfo; this.gridViewItem.GroupPanelText = "Панель группировки"; this.gridViewItem.Name = "gridViewItem"; this.gridViewItem.OptionsCustomization.AllowFilter = false; this.gridViewItem.OptionsDetail.ShowDetailTabs = false; this.gridViewItem.OptionsNavigation.AutoFocusNewRow = true; this.gridViewItem.OptionsSelection.MultiSelect = true; this.gridViewItem.OptionsView.ShowFilterPanelMode = ShowFilterPanelMode.Never; this.gridViewItem.OptionsView.ShowIndicator = false; this.colidSourceInfo.Caption = "#"; this.colidSourceInfo.FieldName = "idSourceInfo"; this.colidSourceInfo.Name = "colidSourceInfo"; this.colidSourceInfo.OptionsColumn.AllowEdit = false; this.colidSourceInfo.OptionsColumn.ReadOnly = true; this.colidSourceInfo.Visible = true; this.colidSourceInfo.VisibleIndex = 0; this.colidSourceInfo.Width = 60; this.colname.Caption = "Источник информации"; this.colname.FieldName = "name"; this.colname.Name = "colname"; this.colname.Visible = true; this.colname.VisibleIndex = 1; this.colname.Width = 263; this.colcomment.Caption = "Комментарий"; this.colcomment.FieldName = "comment"; this.colcomment.Name = "colcomment"; this.colcomment.Visible = true; this.colcomment.VisibleIndex = 2; this.colcomment.Width = 766; this.repositoryItemMemoExEdit1.AutoHeight = false; this.repositoryItemMemoExEdit1.Buttons.AddRange(new EditorButton[1] { new EditorButton(ButtonPredefines.Combo) }); this.repositoryItemMemoExEdit1.Name = "repositoryItemMemoExEdit1"; this.repositoryItemMemoExEdit1.ShowIcon = false; this.repositoryItemPictureEdit1.Name = "repositoryItemPictureEdit1"; this.repositoryItemCheckEdit1.AutoHeight = false; this.repositoryItemCheckEdit1.Name = "repositoryItemCheckEdit1"; this.repositoryItemCheckEdit2.AutoHeight = false; this.repositoryItemCheckEdit2.Name = "repositoryItemCheckEdit2"; this.splitterControl1.Location = new Point(206, 0); this.splitterControl1.Name = "splitterControl1"; this.splitterControl1.Size = new Size(6, 250); this.splitterControl1.TabIndex = 9; this.splitterControl1.TabStop = false; this.treeListGroup.Appearance.FocusedCell.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeListGroup.Appearance.FocusedCell.ForeColor = Color.Black; this.treeListGroup.Appearance.FocusedCell.Options.UseBackColor = true; this.treeListGroup.Appearance.FocusedCell.Options.UseForeColor = true; this.treeListGroup.Appearance.FocusedRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeListGroup.Appearance.FocusedRow.ForeColor = Color.Black; this.treeListGroup.Appearance.FocusedRow.Options.UseBackColor = true; this.treeListGroup.Appearance.FocusedRow.Options.UseForeColor = true; this.treeListGroup.Appearance.HideSelectionRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeListGroup.Appearance.HideSelectionRow.BackColor2 = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeListGroup.Appearance.HideSelectionRow.ForeColor = Color.Black; this.treeListGroup.Appearance.HideSelectionRow.Options.UseBackColor = true; this.treeListGroup.Appearance.HideSelectionRow.Options.UseForeColor = true; this.treeListGroup.Appearance.SelectedRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeListGroup.Appearance.SelectedRow.ForeColor = Color.Black; this.treeListGroup.Appearance.SelectedRow.Options.UseBackColor = true; this.treeListGroup.Appearance.SelectedRow.Options.UseForeColor = true; this.treeListGroup.BorderStyle = BorderStyles.Simple; this.treeListGroup.Columns.AddRange(new TreeListColumn[2] { this.treeListColumn1, this.treeListColumn2 }); this.treeListGroup.ContextMenuStrip = this.MenuGroup; this.treeListGroup.DataMember = "SourceInfogroup"; this.treeListGroup.DataSource = (object)this.ds; this.treeListGroup.Dock = DockStyle.Left; this.treeListGroup.ImageIndexFieldName = "_imageindex"; this.treeListGroup.KeyFieldName = "idSourceInfogroup"; this.treeListGroup.Location = new Point(0, 0); this.treeListGroup.LookAndFeel.Style = LookAndFeelStyle.Flat; this.treeListGroup.LookAndFeel.UseDefaultLookAndFeel = false; this.treeListGroup.Name = "treeListGroup"; this.treeListGroup.OptionsView.ShowHorzLines = false; this.treeListGroup.OptionsView.ShowIndicator = false; this.treeListGroup.OptionsView.ShowVertLines = false; this.treeListGroup.ParentFieldName = "parentid"; this.treeListGroup.SelectImageList = (object)this.imageList1; this.treeListGroup.Size = new Size(206, 250); this.treeListGroup.TabIndex = 8; this.treeListColumn1.Caption = "Группы источников"; this.treeListColumn1.FieldName = "name"; this.treeListColumn1.MinWidth = 112; this.treeListColumn1.Name = "treeListColumn1"; this.treeListColumn1.OptionsColumn.AllowEdit = false; this.treeListColumn1.Visible = true; this.treeListColumn1.VisibleIndex = 0; this.treeListColumn1.Width = 147; this.treeListColumn2.Caption = "V"; this.treeListColumn2.FieldName = "isactive"; this.treeListColumn2.Name = "treeListColumn2"; this.treeListColumn2.Visible = true; this.treeListColumn2.VisibleIndex = 1; this.treeListColumn2.Width = 57; this.MenuGroup.Items.AddRange(new ToolStripItem[8] { (ToolStripItem)this.MenuGroupAddMain, (ToolStripItem)this.MenuGroupAddChild, (ToolStripItem)this.MenuGroupRename, (ToolStripItem)this.toolStripSeparator4, (ToolStripItem)this.MenuGroupRemove, (ToolStripItem)this.toolStripSeparator8, (ToolStripItem)this.MenuGroupMove, (ToolStripItem)this.MenuGroupSetMain }); this.MenuGroup.Name = "contextMenuStrip3"; this.MenuGroup.Size = new Size(298, 148); this.MenuGroupAddMain.Name = "MenuGroupAddMain"; this.MenuGroupAddMain.ShortcutKeys = Keys.Insert | Keys.Control; this.MenuGroupAddMain.Size = new Size(297, 22); this.MenuGroupAddMain.Text = "Добавить основную группу"; this.MenuGroupAddChild.Name = "MenuGroupAddChild"; this.MenuGroupAddChild.ShortcutKeys = Keys.Insert | Keys.Shift | Keys.Control; this.MenuGroupAddChild.Size = new Size(297, 22); this.MenuGroupAddChild.Text = "Добавить дочернюю группу"; this.MenuGroupRename.Name = "MenuGroupRename"; this.MenuGroupRename.ShortcutKeys = Keys.Return | Keys.Control; this.MenuGroupRename.Size = new Size(297, 22); this.MenuGroupRename.Text = "Переименовать"; this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new Size(294, 6); this.MenuGroupRemove.Name = "MenuGroupRemove"; this.MenuGroupRemove.ShortcutKeys = Keys.Delete | Keys.Control; this.MenuGroupRemove.Size = new Size(297, 22); this.MenuGroupRemove.Text = "Удалить"; this.toolStripSeparator8.Name = "toolStripSeparator8"; this.toolStripSeparator8.Size = new Size(294, 6); this.MenuGroupMove.Name = "MenuGroupMove"; this.MenuGroupMove.ShortcutKeys = Keys.F6; this.MenuGroupMove.Size = new Size(297, 22); this.MenuGroupMove.Text = "Переместить в группу"; this.MenuGroupSetMain.Name = "MenuGroupSetMain"; this.MenuGroupSetMain.ShortcutKeys = Keys.M | Keys.Shift | Keys.Control; this.MenuGroupSetMain.Size = new Size(297, 22); this.MenuGroupSetMain.Text = "Сделать группу основной"; this.imageList1.ImageStream = (ImageListStreamer)componentResourceManager.GetObject("imageList1.ImageStream"); this.imageList1.TransparentColor = Color.Magenta; this.imageList1.Images.SetKeyName(0, "Folder.ico"); this.AutoScaleDimensions = new SizeF(6f, 13f); this.AutoScaleMode = AutoScaleMode.Font; this.Controls.Add((Control)this.gridControlSourceInfo); this.Controls.Add((Control)this.splitterControl1); this.Controls.Add((Control)this.treeListGroup); this.Controls.Add((Control)this.panelDialog); this.Controls.Add((Control)this.panelEdit); this.Name = "SourceInfoForm"; this.Size = new Size(598, 316); this.Text = "Источники информации"; this.ds.EndInit(); this.table_SourceInfogroup.EndInit(); this.table_SourceInfo.EndInit(); this.panelDialog.ResumeLayout(false); this.panelEdit.ResumeLayout(false); this.gridControlSourceInfo.EndInit(); this.MenuItem.ResumeLayout(false); this.gridViewItem.EndInit(); this.repositoryItemMemoExEdit1.EndInit(); this.repositoryItemPictureEdit1.EndInit(); this.repositoryItemCheckEdit1.EndInit(); this.repositoryItemCheckEdit2.EndInit(); this.treeListGroup.EndInit(); this.MenuGroup.ResumeLayout(false); this.ResumeLayout(false); }
void grvParams_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e) { if (e.Column.FieldName != "Value") return; var dr = this.grvParams.GetDataRow(e.RowHandle) as DataRow; int iControlType = 0; int.TryParse(dr["ControlType"].ToStringEx(), out iControlType); var controlType = (ViewParameterControlType)iControlType; RepositoryItem item = new RepositoryItemTextEdit(); switch (controlType) { case ViewParameterControlType.CheckEdit: var temp = new RepositoryItemCheckEdit() { AllowGrayed = false }; item = temp; break; case ViewParameterControlType.ComboboxEdit: item = new RepositoryItemGridSearchEdit(); break; case ViewParameterControlType.FloatEdit: item = new RepositoryItemSpinEdit() { IsFloatValue = true }; break; case ViewParameterControlType.IntEdit: item = new RepositoryItemSpinEdit() { IsFloatValue = false }; break; case ViewParameterControlType.RichTextEdit: item = new RepositoryItemMemoExEdit() { ShowIcon = false }; break; case ViewParameterControlType.TextEdit: item = new RepositoryItemTextEdit(); break; default: item = new RepositoryItemTextEdit(); break; } e.RepositoryItem = item; }
private static void InitializeControl(GridControl gridControl) { var gridView = new GridView(); var repositoryItemDateEdit1 = new RepositoryItemDateEdit(); var repositoryItemComboBox1 = new RepositoryItemComboBox(); var repositoryItemTimeEdit1 = new RepositoryItemTimeEdit(); var repositoryItemDateEdit2 = new RepositoryItemDateEdit(); var repositoryItemMemoExEdit1 = new RepositoryItemMemoExEdit(); gridControl.Dock = System.Windows.Forms.DockStyle.Fill; gridControl.Location = new System.Drawing.Point(0, 0); gridControl.MainView = gridView; gridControl.Name = "gridControl"; gridControl.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { repositoryItemDateEdit1, repositoryItemComboBox1, repositoryItemTimeEdit1, repositoryItemDateEdit2, repositoryItemMemoExEdit1 }); gridControl.Size = new System.Drawing.Size(718, 504); gridControl.TabIndex = 26; gridControl.UseEmbeddedNavigator = true; gridControl.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView }); // // gridView // gridView.GridControl = gridControl; gridView.Name = "gridView"; gridView.OptionsSelection.MultiSelect = true; gridView.OptionsView.BestFitMaxRowCount = 10; gridView.OptionsView.ColumnAutoWidth = false; gridView.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom; gridView.OptionsView.ShowAutoFilterRow = true; gridView.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.ShowAlways; gridView.OptionsView.ShowFooter = true; // // repositoryItemDateEdit1 // repositoryItemDateEdit1.AutoHeight = false; repositoryItemDateEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); repositoryItemDateEdit1.CalendarTimeEditing = DevExpress.Utils.DefaultBoolean.True; repositoryItemDateEdit1.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton() }); repositoryItemDateEdit1.CalendarView = DevExpress.XtraEditors.Repository.CalendarView.Vista; repositoryItemDateEdit1.Mask.EditMask = "yyyy/MM/dd HH:mm:ss"; repositoryItemDateEdit1.Mask.UseMaskAsDisplayFormat = true; repositoryItemDateEdit1.Name = "repositoryItemDateEdit1"; repositoryItemDateEdit1.VistaDisplayMode = DevExpress.Utils.DefaultBoolean.True; // // repositoryItemComboBox1 // repositoryItemComboBox1.AutoHeight = false; repositoryItemComboBox1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); repositoryItemComboBox1.Name = "repositoryItemComboBox1"; // // repositoryItemTimeEdit1 // repositoryItemTimeEdit1.AutoHeight = false; repositoryItemTimeEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton() }); repositoryItemTimeEdit1.Name = "repositoryItemTimeEdit1"; // // repositoryItemDateEdit2 // repositoryItemDateEdit2.AutoHeight = false; repositoryItemDateEdit2.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); repositoryItemDateEdit2.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton() }); repositoryItemDateEdit2.Name = "repositoryItemDateEdit2"; // // repositoryItemMemoExEdit1 // repositoryItemMemoExEdit1.AutoHeight = false; repositoryItemMemoExEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); repositoryItemMemoExEdit1.Name = "repositoryItemMemoExEdit1"; repositoryItemMemoExEdit1.ReadOnly = true; repositoryItemMemoExEdit1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; repositoryItemMemoExEdit1.ShowIcon = false; }
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; }
public static RepositoryItemMemoExEdit GetMemoExEdit() { RepositoryItemMemoExEdit MemoEditColumn = new RepositoryItemMemoExEdit(); //((System.ComponentModel.ISupportInitialize)(MemoEditColumn)).BeginInit(); //MemoEditColumn.Name = "MemoEditColumn"; //((System.ComponentModel.ISupportInitialize)(MemoEditColumn)).EndInit(); return MemoEditColumn; }
private void InitGrid() { this.view.BeginUpdate(); this.view.OptionsView.ShowGroupPanel = false; this.view.OptionsView.ShowHorzLines = true; this.view.OptionsView.ShowVertLines = true; this.view.OptionsSelection.MultiSelect = true; RepositoryItemButtonEdit edit = new RepositoryItemButtonEdit(); RepositoryItemTextEdit edit2 = new RepositoryItemTextEdit(); RepositoryItemMemoExEdit edit3 = new RepositoryItemMemoExEdit(); string[] strArray = new string[] { "Name", "CreateStaffName", "CreateDate", "Description" }; string[] strArray2 = new string[] { "附件名称", "创建人", "创建时间", "备注" }; GridColumn[] columns = new GridColumn[4]; for (int i = 0; i < 4; i++) { columns[i] = new GridColumn(); columns[i].FieldName = strArray[i]; columns[i].Caption = strArray2[i]; columns[i].VisibleIndex = i; } this.view.Columns.AddRange(columns); columns[0].ColumnEdit = edit; columns[3].ColumnEdit = edit3; columns[1].ColumnEdit = edit2; columns[2].ColumnEdit = edit2; columns[1].ColumnEdit.ReadOnly = true; columns[2].ColumnEdit.ReadOnly = true; edit.ButtonClick += new ButtonPressedEventHandler(this.BtEditClick); edit.EditValueChanged += new EventHandler(this.ValueChanged); edit3.EditValueChanged += new EventHandler(this.ValueChanged); edit2.EditValueChanged += new EventHandler(this.ValueChanged); this.view.EndUpdate(); }
private void InitializeComponent() { this.gpgLogGrid = new GPGChatGrid(); this.gvLogView = new GridView(); this.colTime = new GridColumn(); this.repositoryItemTimeEdit1 = new RepositoryItemTimeEdit(); this.colType = new GridColumn(); this.colDescription = new GridColumn(); this.colData = new GridColumn(); this.rimMemoEdit3 = new RepositoryItemMemoEdit(); this.rimPictureEdit3 = new RepositoryItemPictureEdit(); this.rimTextEdit = new RepositoryItemTextEdit(); this.riPopup = new RepositoryItemPopupContainerEdit(); this.pcPropertyView = new PopupContainerControl(); this.pgData = new PropertyGridControl(); this.repositoryItemMemoExEdit1 = new RepositoryItemMemoExEdit(); this.btnCancel = new GPGButton(); this.gpgLogGrid.BeginInit(); this.gvLogView.BeginInit(); this.repositoryItemTimeEdit1.BeginInit(); this.rimMemoEdit3.BeginInit(); this.rimPictureEdit3.BeginInit(); this.rimTextEdit.BeginInit(); this.riPopup.BeginInit(); this.pcPropertyView.BeginInit(); this.pcPropertyView.SuspendLayout(); this.pgData.BeginInit(); this.repositoryItemMemoExEdit1.BeginInit(); base.SuspendLayout(); base.ttDefault.DefaultController.AutoPopDelay = 0x3e8; this.gpgLogGrid.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.gpgLogGrid.CustomizeStyle = false; this.gpgLogGrid.EmbeddedNavigator.Name = ""; this.gpgLogGrid.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0); this.gpgLogGrid.IgnoreMouseWheel = false; this.gpgLogGrid.Location = new Point(13, 0x4c); this.gpgLogGrid.LookAndFeel.SkinName = "Money Twins"; this.gpgLogGrid.LookAndFeel.UseDefaultLookAndFeel = false; this.gpgLogGrid.MainView = this.gvLogView; this.gpgLogGrid.Name = "gpgLogGrid"; this.gpgLogGrid.RepositoryItems.AddRange(new RepositoryItem[] { this.rimPictureEdit3, this.rimTextEdit, this.rimMemoEdit3, this.riPopup, this.repositoryItemTimeEdit1, this.repositoryItemMemoExEdit1 }); this.gpgLogGrid.ShowOnlyPredefinedDetails = true; this.gpgLogGrid.Size = new Size(0x268, 0x138); this.gpgLogGrid.TabIndex = 0x1c; this.gpgLogGrid.ViewCollection.AddRange(new BaseView[] { this.gvLogView }); this.gvLogView.ActiveFilterString = ""; this.gvLogView.Appearance.ColumnFilterButton.BackColor = Color.Black; this.gvLogView.Appearance.ColumnFilterButton.BackColor2 = Color.FromArgb(20, 20, 20); this.gvLogView.Appearance.ColumnFilterButton.BorderColor = Color.Black; this.gvLogView.Appearance.ColumnFilterButton.ForeColor = Color.Gray; this.gvLogView.Appearance.ColumnFilterButton.Options.UseBackColor = true; this.gvLogView.Appearance.ColumnFilterButton.Options.UseBorderColor = true; this.gvLogView.Appearance.ColumnFilterButton.Options.UseForeColor = true; this.gvLogView.Appearance.ColumnFilterButtonActive.BackColor = Color.FromArgb(20, 20, 20); this.gvLogView.Appearance.ColumnFilterButtonActive.BackColor2 = Color.FromArgb(0x4e, 0x4e, 0x4e); this.gvLogView.Appearance.ColumnFilterButtonActive.BorderColor = Color.FromArgb(20, 20, 20); this.gvLogView.Appearance.ColumnFilterButtonActive.ForeColor = Color.Blue; this.gvLogView.Appearance.ColumnFilterButtonActive.Options.UseBackColor = true; this.gvLogView.Appearance.ColumnFilterButtonActive.Options.UseBorderColor = true; this.gvLogView.Appearance.ColumnFilterButtonActive.Options.UseForeColor = true; this.gvLogView.Appearance.Empty.BackColor = Color.Black; this.gvLogView.Appearance.Empty.Options.UseBackColor = true; this.gvLogView.Appearance.FilterCloseButton.BackColor = Color.FromArgb(0xd4, 0xd0, 200); this.gvLogView.Appearance.FilterCloseButton.BackColor2 = Color.FromArgb(90, 90, 90); this.gvLogView.Appearance.FilterCloseButton.BorderColor = Color.FromArgb(0xd4, 0xd0, 200); this.gvLogView.Appearance.FilterCloseButton.ForeColor = Color.Black; this.gvLogView.Appearance.FilterCloseButton.GradientMode = LinearGradientMode.ForwardDiagonal; this.gvLogView.Appearance.FilterCloseButton.Options.UseBackColor = true; this.gvLogView.Appearance.FilterCloseButton.Options.UseBorderColor = true; this.gvLogView.Appearance.FilterCloseButton.Options.UseForeColor = true; this.gvLogView.Appearance.FilterPanel.BackColor = Color.Black; this.gvLogView.Appearance.FilterPanel.BackColor2 = Color.FromArgb(0xd4, 0xd0, 200); this.gvLogView.Appearance.FilterPanel.ForeColor = Color.White; this.gvLogView.Appearance.FilterPanel.GradientMode = LinearGradientMode.ForwardDiagonal; this.gvLogView.Appearance.FilterPanel.Options.UseBackColor = true; this.gvLogView.Appearance.FilterPanel.Options.UseForeColor = true; this.gvLogView.Appearance.FixedLine.BackColor = Color.FromArgb(0x3a, 0x3a, 0x3a); this.gvLogView.Appearance.FixedLine.Options.UseBackColor = true; this.gvLogView.Appearance.FocusedCell.BackColor = Color.Black; this.gvLogView.Appearance.FocusedCell.Font = new Font("Tahoma", 10f); this.gvLogView.Appearance.FocusedCell.ForeColor = Color.White; this.gvLogView.Appearance.FocusedCell.Options.UseBackColor = true; this.gvLogView.Appearance.FocusedCell.Options.UseFont = true; this.gvLogView.Appearance.FocusedCell.Options.UseForeColor = true; this.gvLogView.Appearance.FocusedRow.BackColor = Color.FromArgb(0xbb, 0xc9, 0xe2); this.gvLogView.Appearance.FocusedRow.BackColor2 = Color.FromArgb(0x52, 0x83, 190); this.gvLogView.Appearance.FocusedRow.Font = new Font("Arial", 9.75f); this.gvLogView.Appearance.FocusedRow.ForeColor = Color.White; this.gvLogView.Appearance.FocusedRow.GradientMode = LinearGradientMode.ForwardDiagonal; this.gvLogView.Appearance.FocusedRow.Options.UseBackColor = true; this.gvLogView.Appearance.FocusedRow.Options.UseFont = true; this.gvLogView.Appearance.FocusedRow.Options.UseForeColor = true; this.gvLogView.Appearance.FooterPanel.BackColor = Color.Black; this.gvLogView.Appearance.FooterPanel.BorderColor = Color.Black; this.gvLogView.Appearance.FooterPanel.Font = new Font("Tahoma", 10f); this.gvLogView.Appearance.FooterPanel.ForeColor = Color.White; this.gvLogView.Appearance.FooterPanel.Options.UseBackColor = true; this.gvLogView.Appearance.FooterPanel.Options.UseBorderColor = true; this.gvLogView.Appearance.FooterPanel.Options.UseFont = true; this.gvLogView.Appearance.FooterPanel.Options.UseForeColor = true; this.gvLogView.Appearance.GroupButton.BackColor = Color.Black; this.gvLogView.Appearance.GroupButton.BorderColor = Color.Black; this.gvLogView.Appearance.GroupButton.ForeColor = Color.White; this.gvLogView.Appearance.GroupButton.Options.UseBackColor = true; this.gvLogView.Appearance.GroupButton.Options.UseBorderColor = true; this.gvLogView.Appearance.GroupButton.Options.UseForeColor = true; this.gvLogView.Appearance.GroupFooter.BackColor = Color.FromArgb(10, 10, 10); this.gvLogView.Appearance.GroupFooter.BorderColor = Color.FromArgb(10, 10, 10); this.gvLogView.Appearance.GroupFooter.ForeColor = Color.White; this.gvLogView.Appearance.GroupFooter.Options.UseBackColor = true; this.gvLogView.Appearance.GroupFooter.Options.UseBorderColor = true; this.gvLogView.Appearance.GroupFooter.Options.UseForeColor = true; this.gvLogView.Appearance.GroupPanel.BackColor = Color.Black; this.gvLogView.Appearance.GroupPanel.BackColor2 = Color.Black; this.gvLogView.Appearance.GroupPanel.Font = new Font("Tahoma", 10f, FontStyle.Bold); this.gvLogView.Appearance.GroupPanel.ForeColor = Color.White; this.gvLogView.Appearance.GroupPanel.Options.UseBackColor = true; this.gvLogView.Appearance.GroupPanel.Options.UseFont = true; this.gvLogView.Appearance.GroupPanel.Options.UseForeColor = true; this.gvLogView.Appearance.GroupRow.BackColor = Color.Gray; this.gvLogView.Appearance.GroupRow.Font = new Font("Tahoma", 10f); this.gvLogView.Appearance.GroupRow.ForeColor = Color.White; this.gvLogView.Appearance.GroupRow.Options.UseBackColor = true; this.gvLogView.Appearance.GroupRow.Options.UseFont = true; this.gvLogView.Appearance.GroupRow.Options.UseForeColor = true; this.gvLogView.Appearance.HeaderPanel.BackColor = Color.Black; this.gvLogView.Appearance.HeaderPanel.BorderColor = Color.Black; this.gvLogView.Appearance.HeaderPanel.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0); this.gvLogView.Appearance.HeaderPanel.ForeColor = Color.Black; this.gvLogView.Appearance.HeaderPanel.Options.UseBackColor = true; this.gvLogView.Appearance.HeaderPanel.Options.UseBorderColor = true; this.gvLogView.Appearance.HeaderPanel.Options.UseFont = true; this.gvLogView.Appearance.HeaderPanel.Options.UseForeColor = true; this.gvLogView.Appearance.HideSelectionRow.BackColor = Color.Gray; this.gvLogView.Appearance.HideSelectionRow.Font = new Font("Tahoma", 10f); this.gvLogView.Appearance.HideSelectionRow.ForeColor = Color.FromArgb(0xd4, 0xd0, 200); this.gvLogView.Appearance.HideSelectionRow.Options.UseBackColor = true; this.gvLogView.Appearance.HideSelectionRow.Options.UseFont = true; this.gvLogView.Appearance.HideSelectionRow.Options.UseForeColor = true; this.gvLogView.Appearance.HorzLine.BackColor = Color.FromArgb(0x52, 0x83, 190); this.gvLogView.Appearance.HorzLine.Options.UseBackColor = true; this.gvLogView.Appearance.Preview.BackColor = Color.White; this.gvLogView.Appearance.Preview.Font = new Font("Tahoma", 10f); this.gvLogView.Appearance.Preview.ForeColor = Color.Purple; this.gvLogView.Appearance.Preview.Options.UseBackColor = true; this.gvLogView.Appearance.Preview.Options.UseFont = true; this.gvLogView.Appearance.Preview.Options.UseForeColor = true; this.gvLogView.Appearance.Row.BackColor = Color.Black; this.gvLogView.Appearance.Row.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0xb2); this.gvLogView.Appearance.Row.ForeColor = Color.White; this.gvLogView.Appearance.Row.Options.UseBackColor = true; this.gvLogView.Appearance.Row.Options.UseFont = true; this.gvLogView.Appearance.Row.Options.UseForeColor = true; this.gvLogView.Appearance.RowSeparator.BackColor = Color.White; this.gvLogView.Appearance.RowSeparator.BackColor2 = Color.White; this.gvLogView.Appearance.RowSeparator.Options.UseBackColor = true; this.gvLogView.Appearance.SelectedRow.BackColor = Color.FromArgb(0xbb, 0xc9, 0xe2); this.gvLogView.Appearance.SelectedRow.BackColor2 = Color.FromArgb(0x52, 0x83, 190); this.gvLogView.Appearance.SelectedRow.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0); this.gvLogView.Appearance.SelectedRow.ForeColor = Color.White; this.gvLogView.Appearance.SelectedRow.GradientMode = LinearGradientMode.ForwardDiagonal; this.gvLogView.Appearance.SelectedRow.Options.UseBackColor = true; this.gvLogView.Appearance.SelectedRow.Options.UseFont = true; this.gvLogView.Appearance.SelectedRow.Options.UseForeColor = true; this.gvLogView.Appearance.TopNewRow.Font = new Font("Tahoma", 10f); this.gvLogView.Appearance.TopNewRow.ForeColor = Color.White; this.gvLogView.Appearance.TopNewRow.Options.UseFont = true; this.gvLogView.Appearance.TopNewRow.Options.UseForeColor = true; this.gvLogView.Appearance.VertLine.BackColor = Color.FromArgb(0x52, 0x83, 190); this.gvLogView.Appearance.VertLine.Options.UseBackColor = true; this.gvLogView.BorderStyle = BorderStyles.NoBorder; this.gvLogView.Columns.AddRange(new GridColumn[] { this.colTime, this.colType, this.colDescription, this.colData }); this.gvLogView.GridControl = this.gpgLogGrid; this.gvLogView.Name = "gvLogView"; this.gvLogView.OptionsBehavior.AutoPopulateColumns = false; this.gvLogView.OptionsDetail.AllowZoomDetail = false; this.gvLogView.OptionsDetail.EnableMasterViewMode = false; this.gvLogView.OptionsDetail.ShowDetailTabs = false; this.gvLogView.OptionsDetail.SmartDetailExpand = false; this.gvLogView.OptionsSelection.EnableAppearanceFocusedCell = false; this.gvLogView.OptionsSelection.MultiSelect = true; this.gvLogView.OptionsView.RowAutoHeight = true; 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.repositoryItemTimeEdit1.AutoHeight = false; this.repositoryItemTimeEdit1.Buttons.AddRange(new EditorButton[] { new EditorButton() }); this.repositoryItemTimeEdit1.Name = "repositoryItemTimeEdit1"; 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.rimMemoEdit3; this.colData.FieldName = "Data"; this.colData.Name = "colData"; this.colData.Visible = true; this.colData.VisibleIndex = 3; this.rimMemoEdit3.MaxLength = 500; this.rimMemoEdit3.Name = "rimMemoEdit3"; this.rimPictureEdit3.Name = "rimPictureEdit3"; this.rimPictureEdit3.PictureAlignment = ContentAlignment.TopCenter; this.rimTextEdit.AutoHeight = false; this.rimTextEdit.Name = "rimTextEdit"; this.riPopup.AutoHeight = false; this.riPopup.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) }); this.riPopup.Name = "riPopup"; this.riPopup.PopupControl = this.pcPropertyView; this.riPopup.Popup += new EventHandler(this.riPopup_Popup); this.pcPropertyView.Controls.Add(this.pgData); this.pcPropertyView.Location = new Point(13, 0xda); this.pcPropertyView.Name = "pcPropertyView"; this.pcPropertyView.Size = new Size(0xdf, 180); this.pcPropertyView.TabIndex = 0x1f; this.pcPropertyView.Text = "popupContainerControl1"; this.pgData.Dock = DockStyle.Fill; this.pgData.Location = new Point(0, 0); this.pgData.Name = "pgData"; this.pgData.Size = new Size(0xdf, 180); this.pgData.TabIndex = 0; this.repositoryItemMemoExEdit1.AutoHeight = false; this.repositoryItemMemoExEdit1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) }); this.repositoryItemMemoExEdit1.Name = "repositoryItemMemoExEdit1"; this.btnCancel.Anchor = AnchorStyles.Right | AnchorStyles.Bottom; this.btnCancel.Appearance.ForeColor = Color.Black; this.btnCancel.Appearance.Options.UseForeColor = true; this.btnCancel.Location = new Point(0x20d, 0x18a); this.btnCancel.LookAndFeel.SkinName = "London Liquid Sky"; this.btnCancel.LookAndFeel.UseDefaultLookAndFeel = false; this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new Size(0x68, 0x17); this.btnCancel.TabIndex = 30; this.btnCancel.Text = "<LOC>Cancel"; this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.Click += new EventHandler(this.btnCancel_Click); base.AutoScaleMode = AutoScaleMode.None; base.ClientSize = new Size(640, 480); base.Controls.Add(this.pcPropertyView); base.Controls.Add(this.btnCancel); base.Controls.Add(this.gpgLogGrid); this.Font = new Font("Verdana", 8f); base.Location = new Point(0, 0); base.Name = "DlgLogWatcher"; this.Text = "Log Watcher"; base.Controls.SetChildIndex(this.gpgLogGrid, 0); base.Controls.SetChildIndex(this.btnCancel, 0); base.Controls.SetChildIndex(this.pcPropertyView, 0); this.gpgLogGrid.EndInit(); this.gvLogView.EndInit(); this.repositoryItemTimeEdit1.EndInit(); this.rimMemoEdit3.EndInit(); this.rimPictureEdit3.EndInit(); this.rimTextEdit.EndInit(); this.riPopup.EndInit(); this.pcPropertyView.EndInit(); this.pcPropertyView.ResumeLayout(false); this.pgData.EndInit(); this.repositoryItemMemoExEdit1.EndInit(); base.ResumeLayout(false); base.PerformLayout(); }
private void InitializeComponent() { this.components = (IContainer) new Container(); ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(AddClassification)); this.panelDialog = new Panel(); this.cmdCancel = new Button(); this.cmdOk = new Button(); this.panelEdit = new Panel(); this.cmdClose = new Button(); this.cmdReLoad = new Button(); this.cmdSave = new Button(); this.gridControlAddClassification = new GridControl(); this.MenuItem = new ContextMenuStrip(this.components); this.MenuItemAdd = new ToolStripMenuItem(); this.toolStripSeparator1 = new ToolStripSeparator(); this.MenuItemRemove = new ToolStripMenuItem(); this.toolStripSeparator2 = new ToolStripSeparator(); this.MenuItemMove = new ToolStripMenuItem(); this.ds = new ds_addclassification(); this.gridViewItem = new GridView(); this.colidSourceInfo = new GridColumn(); this.colname = new GridColumn(); this.colcomment = new GridColumn(); this.repositoryItemMemoExEdit1 = new RepositoryItemMemoExEdit(); this.repositoryItemPictureEdit1 = new RepositoryItemPictureEdit(); this.repositoryItemCheckEdit1 = new RepositoryItemCheckEdit(); this.repositoryItemCheckEdit2 = new RepositoryItemCheckEdit(); this.splitterControl1 = new SplitterControl(); this.treeListGroup = new TreeList(); this.treeListColumn1 = new TreeListColumn(); this.treeListColumn2 = new TreeListColumn(); this.MenuGroup = new ContextMenuStrip(this.components); this.MenuGroupAddMain = new ToolStripMenuItem(); this.MenuGroupAddChild = new ToolStripMenuItem(); this.MenuGroupRename = new ToolStripMenuItem(); this.toolStripSeparator4 = new ToolStripSeparator(); this.MenuGroupRemove = new ToolStripMenuItem(); this.toolStripSeparator8 = new ToolStripSeparator(); this.MenuGroupMove = new ToolStripMenuItem(); this.MenuGroupSetMain = new ToolStripMenuItem(); this.imageList1 = new ImageList(this.components); this.colnumval = new GridColumn(); this.colintval = new GridColumn(); this.colstrval = new GridColumn(); this.panelDialog.SuspendLayout(); this.panelEdit.SuspendLayout(); this.gridControlAddClassification.BeginInit(); this.MenuItem.SuspendLayout(); this.ds.BeginInit(); this.gridViewItem.BeginInit(); this.repositoryItemMemoExEdit1.BeginInit(); this.repositoryItemPictureEdit1.BeginInit(); this.repositoryItemCheckEdit1.BeginInit(); this.repositoryItemCheckEdit2.BeginInit(); this.treeListGroup.BeginInit(); this.MenuGroup.SuspendLayout(); this.SuspendLayout(); this.panelDialog.Controls.Add((Control)this.cmdCancel); this.panelDialog.Controls.Add((Control)this.cmdOk); this.panelDialog.Dock = DockStyle.Bottom; this.panelDialog.Location = new Point(0, 418); this.panelDialog.Name = "panelDialog"; this.panelDialog.Size = new Size(847, 33); this.panelDialog.TabIndex = 5; this.panelDialog.Visible = false; this.cmdCancel.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdCancel.DialogResult = DialogResult.Cancel; this.cmdCancel.FlatStyle = FlatStyle.Flat; this.cmdCancel.Location = new Point(760, 5); this.cmdCancel.Name = "cmdCancel"; this.cmdCancel.Size = new Size(75, 23); this.cmdCancel.TabIndex = 2; this.cmdCancel.Text = "Отменить"; this.cmdCancel.Click += new EventHandler(this.cmdCancel_Click); this.cmdOk.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdOk.DialogResult = DialogResult.OK; this.cmdOk.FlatStyle = FlatStyle.Flat; this.cmdOk.Location = new Point(679, 5); this.cmdOk.Name = "cmdOk"; this.cmdOk.Size = new Size(75, 23); this.cmdOk.TabIndex = 1; this.cmdOk.Text = "Выбрать"; this.cmdOk.Click += new EventHandler(this.cmdOk_Click); this.panelEdit.Controls.Add((Control)this.cmdClose); this.panelEdit.Controls.Add((Control)this.cmdReLoad); this.panelEdit.Controls.Add((Control)this.cmdSave); this.panelEdit.Dock = DockStyle.Bottom; this.panelEdit.Location = new Point(0, 451); this.panelEdit.Name = "panelEdit"; this.panelEdit.Size = new Size(847, 33); this.panelEdit.TabIndex = 4; this.cmdClose.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdClose.FlatStyle = FlatStyle.Flat; this.cmdClose.Location = new Point(760, 5); this.cmdClose.Name = "cmdClose"; this.cmdClose.Size = new Size(75, 23); this.cmdClose.TabIndex = 2; this.cmdClose.Text = "Закрыть"; this.cmdClose.Click += new EventHandler(this.cmdClose_Click); this.cmdReLoad.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdReLoad.FlatStyle = FlatStyle.Flat; this.cmdReLoad.Location = new Point(679, 5); this.cmdReLoad.Name = "cmdReLoad"; this.cmdReLoad.Size = new Size(75, 23); this.cmdReLoad.TabIndex = 1; this.cmdReLoad.Text = "Отменить"; this.cmdReLoad.Click += new EventHandler(this.cmdReLoad_Click); this.cmdSave.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.cmdSave.FlatStyle = FlatStyle.Flat; this.cmdSave.Location = new Point(598, 5); this.cmdSave.Name = "cmdSave"; this.cmdSave.Size = new Size(75, 23); this.cmdSave.TabIndex = 0; this.cmdSave.Text = "Применить"; this.cmdSave.Click += new EventHandler(this.cmdSave_Click); this.gridControlAddClassification.ContextMenuStrip = this.MenuItem; this.gridControlAddClassification.DataMember = "addclassificationgroup.addclassificationgroup_addclassification"; this.gridControlAddClassification.DataSource = (object)this.ds; this.gridControlAddClassification.Dock = DockStyle.Fill; this.gridControlAddClassification.EmbeddedNavigator.Name = ""; this.gridControlAddClassification.Location = new Point(212, 0); this.gridControlAddClassification.LookAndFeel.Style = LookAndFeelStyle.Flat; this.gridControlAddClassification.LookAndFeel.UseDefaultLookAndFeel = false; this.gridControlAddClassification.MainView = (BaseView)this.gridViewItem; this.gridControlAddClassification.Name = "gridControlAddClassification"; this.gridControlAddClassification.RepositoryItems.AddRange(new RepositoryItem[4] { (RepositoryItem)this.repositoryItemMemoExEdit1, (RepositoryItem)this.repositoryItemPictureEdit1, (RepositoryItem)this.repositoryItemCheckEdit1, (RepositoryItem)this.repositoryItemCheckEdit2 }); this.gridControlAddClassification.Size = new Size(635, 418); this.gridControlAddClassification.TabIndex = 7; this.gridControlAddClassification.ViewCollection.AddRange(new BaseView[1] { (BaseView)this.gridViewItem }); this.MenuItem.Items.AddRange(new ToolStripItem[5] { (ToolStripItem)this.MenuItemAdd, (ToolStripItem)this.toolStripSeparator1, (ToolStripItem)this.MenuItemRemove, (ToolStripItem)this.toolStripSeparator2, (ToolStripItem)this.MenuItemMove }); this.MenuItem.Name = "MenuItem"; this.MenuItem.Size = new Size(207, 82); this.MenuItemAdd.Name = "MenuItemAdd"; this.MenuItemAdd.ShortcutKeys = Keys.Insert | Keys.Control; this.MenuItemAdd.Size = new Size(206, 22); this.MenuItemAdd.Text = "Добавить"; this.MenuItemAdd.Click += new EventHandler(this.MenuItemAdd_Click_1); this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new Size(203, 6); this.MenuItemRemove.Name = "MenuItemRemove"; this.MenuItemRemove.ShortcutKeys = Keys.Delete | Keys.Control; this.MenuItemRemove.Size = new Size(206, 22); this.MenuItemRemove.Text = "Удалить"; this.MenuItemRemove.Click += new EventHandler(this.MenuItemRemove_Click); this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new Size(203, 6); this.MenuItemMove.Name = "MenuItemMove"; this.MenuItemMove.ShortcutKeys = Keys.F6; this.MenuItemMove.Size = new Size(206, 22); this.MenuItemMove.Text = "Переместить в группу"; this.MenuItemMove.Click += new EventHandler(this.MenuItemMove_Click); this.ds.DataSetName = "ds_addclassification"; this.ds.SchemaSerializationMode = SchemaSerializationMode.IncludeSchema; this.gridViewItem.Appearance.FocusedRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.FocusedRow.BackColor2 = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.FocusedRow.BorderColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.FocusedRow.ForeColor = Color.Black; this.gridViewItem.Appearance.FocusedRow.Options.UseBackColor = true; this.gridViewItem.Appearance.FocusedRow.Options.UseBorderColor = true; this.gridViewItem.Appearance.FocusedRow.Options.UseForeColor = true; this.gridViewItem.Appearance.GroupPanel.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.GroupPanel.BackColor2 = Color.FromArgb(192, 192, (int)byte.MaxValue); this.gridViewItem.Appearance.GroupPanel.Options.UseBackColor = true; this.gridViewItem.Appearance.HideSelectionRow.BackColor = Color.FromArgb(192, 192, (int)byte.MaxValue); this.gridViewItem.Appearance.HideSelectionRow.BackColor2 = Color.FromArgb(192, 192, (int)byte.MaxValue); this.gridViewItem.Appearance.HideSelectionRow.BorderColor = Color.FromArgb(192, 192, (int)byte.MaxValue); this.gridViewItem.Appearance.HideSelectionRow.ForeColor = Color.Black; this.gridViewItem.Appearance.HideSelectionRow.Options.UseBackColor = true; this.gridViewItem.Appearance.HideSelectionRow.Options.UseBorderColor = true; this.gridViewItem.Appearance.HideSelectionRow.Options.UseForeColor = true; this.gridViewItem.Appearance.SelectedRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.SelectedRow.BackColor2 = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.SelectedRow.BorderColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.gridViewItem.Appearance.SelectedRow.ForeColor = Color.Black; this.gridViewItem.Appearance.SelectedRow.Options.UseBackColor = true; this.gridViewItem.Appearance.SelectedRow.Options.UseBorderColor = true; this.gridViewItem.Appearance.SelectedRow.Options.UseForeColor = true; this.gridViewItem.BorderStyle = BorderStyles.Simple; this.gridViewItem.Columns.AddRange(new GridColumn[6] { this.colidSourceInfo, this.colname, this.colcomment, this.colnumval, this.colintval, this.colstrval }); this.gridViewItem.GridControl = this.gridControlAddClassification; this.gridViewItem.GroupPanelText = "Панель группировки"; this.gridViewItem.Name = "gridViewItem"; this.gridViewItem.OptionsCustomization.AllowFilter = false; this.gridViewItem.OptionsDetail.ShowDetailTabs = false; this.gridViewItem.OptionsNavigation.AutoFocusNewRow = true; this.gridViewItem.OptionsSelection.MultiSelect = true; this.gridViewItem.OptionsView.ShowFilterPanelMode = ShowFilterPanelMode.Never; this.gridViewItem.OptionsView.ShowIndicator = false; this.gridViewItem.DoubleClick += new EventHandler(this.gridViewItem_DoubleClick); this.colidSourceInfo.Caption = "#"; this.colidSourceInfo.FieldName = "idaddclassification"; this.colidSourceInfo.Name = "colidSourceInfo"; this.colidSourceInfo.OptionsColumn.AllowEdit = false; this.colidSourceInfo.OptionsColumn.ReadOnly = true; this.colidSourceInfo.Visible = true; this.colidSourceInfo.VisibleIndex = 0; this.colidSourceInfo.Width = 60; this.colname.Caption = "Источник информации"; this.colname.FieldName = "name"; this.colname.Name = "colname"; this.colname.Visible = true; this.colname.VisibleIndex = 1; this.colname.Width = 263; this.colcomment.Caption = "Комментарий"; this.colcomment.FieldName = "comment"; this.colcomment.Name = "colcomment"; this.colcomment.Visible = true; this.colcomment.VisibleIndex = 2; this.colcomment.Width = 766; this.repositoryItemMemoExEdit1.AutoHeight = false; this.repositoryItemMemoExEdit1.Buttons.AddRange(new EditorButton[1] { new EditorButton(ButtonPredefines.Combo) }); this.repositoryItemMemoExEdit1.Name = "repositoryItemMemoExEdit1"; this.repositoryItemMemoExEdit1.ShowIcon = false; this.repositoryItemPictureEdit1.Name = "repositoryItemPictureEdit1"; this.repositoryItemCheckEdit1.AutoHeight = false; this.repositoryItemCheckEdit1.Name = "repositoryItemCheckEdit1"; this.repositoryItemCheckEdit2.AutoHeight = false; this.repositoryItemCheckEdit2.Name = "repositoryItemCheckEdit2"; this.splitterControl1.Location = new Point(206, 0); this.splitterControl1.Name = "splitterControl1"; this.splitterControl1.Size = new Size(6, 418); this.splitterControl1.TabIndex = 9; this.splitterControl1.TabStop = false; this.treeListGroup.Appearance.FocusedCell.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeListGroup.Appearance.FocusedCell.ForeColor = Color.Black; this.treeListGroup.Appearance.FocusedCell.Options.UseBackColor = true; this.treeListGroup.Appearance.FocusedCell.Options.UseForeColor = true; this.treeListGroup.Appearance.FocusedRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeListGroup.Appearance.FocusedRow.ForeColor = Color.Black; this.treeListGroup.Appearance.FocusedRow.Options.UseBackColor = true; this.treeListGroup.Appearance.FocusedRow.Options.UseForeColor = true; this.treeListGroup.Appearance.HideSelectionRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeListGroup.Appearance.HideSelectionRow.BackColor2 = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeListGroup.Appearance.HideSelectionRow.ForeColor = Color.Black; this.treeListGroup.Appearance.HideSelectionRow.Options.UseBackColor = true; this.treeListGroup.Appearance.HideSelectionRow.Options.UseForeColor = true; this.treeListGroup.Appearance.SelectedRow.BackColor = Color.FromArgb(128, 128, (int)byte.MaxValue); this.treeListGroup.Appearance.SelectedRow.ForeColor = Color.Black; this.treeListGroup.Appearance.SelectedRow.Options.UseBackColor = true; this.treeListGroup.Appearance.SelectedRow.Options.UseForeColor = true; this.treeListGroup.BorderStyle = BorderStyles.Simple; this.treeListGroup.Columns.AddRange(new TreeListColumn[2] { this.treeListColumn1, this.treeListColumn2 }); this.treeListGroup.ContextMenuStrip = this.MenuGroup; this.treeListGroup.DataMember = "addclassificationgroup"; this.treeListGroup.DataSource = (object)this.ds; this.treeListGroup.Dock = DockStyle.Left; this.treeListGroup.ImageIndexFieldName = "_imageindex"; this.treeListGroup.KeyFieldName = "idaddclassificationgroup"; this.treeListGroup.Location = new Point(0, 0); this.treeListGroup.LookAndFeel.Style = LookAndFeelStyle.Flat; this.treeListGroup.LookAndFeel.UseDefaultLookAndFeel = false; this.treeListGroup.Name = "treeListGroup"; this.treeListGroup.OptionsView.ShowHorzLines = false; this.treeListGroup.OptionsView.ShowIndicator = false; this.treeListGroup.OptionsView.ShowVertLines = false; this.treeListGroup.ParentFieldName = "parentid"; this.treeListGroup.SelectImageList = (object)this.imageList1; this.treeListGroup.Size = new Size(206, 418); this.treeListGroup.TabIndex = 8; this.treeListColumn1.Caption = "Группы источников"; this.treeListColumn1.FieldName = "name"; this.treeListColumn1.MinWidth = 112; this.treeListColumn1.Name = "treeListColumn1"; this.treeListColumn1.OptionsColumn.AllowEdit = false; this.treeListColumn1.Visible = true; this.treeListColumn1.VisibleIndex = 0; this.treeListColumn1.Width = 147; this.treeListColumn2.Caption = "V"; this.treeListColumn2.FieldName = "isactive"; this.treeListColumn2.Name = "treeListColumn2"; this.treeListColumn2.Visible = true; this.treeListColumn2.VisibleIndex = 1; this.treeListColumn2.Width = 57; this.MenuGroup.Items.AddRange(new ToolStripItem[8] { (ToolStripItem)this.MenuGroupAddMain, (ToolStripItem)this.MenuGroupAddChild, (ToolStripItem)this.MenuGroupRename, (ToolStripItem)this.toolStripSeparator4, (ToolStripItem)this.MenuGroupRemove, (ToolStripItem)this.toolStripSeparator8, (ToolStripItem)this.MenuGroupMove, (ToolStripItem)this.MenuGroupSetMain }); this.MenuGroup.Name = "contextMenuStrip3"; this.MenuGroup.Size = new Size(298, 148); this.MenuGroupAddMain.Name = "MenuGroupAddMain"; this.MenuGroupAddMain.ShortcutKeys = Keys.Insert | Keys.Control; this.MenuGroupAddMain.Size = new Size(297, 22); this.MenuGroupAddMain.Text = "Добавить основную группу"; this.MenuGroupAddMain.Click += new EventHandler(this.MenuGroupAddMain_Click); this.MenuGroupAddChild.Name = "MenuGroupAddChild"; this.MenuGroupAddChild.ShortcutKeys = Keys.Insert | Keys.Shift | Keys.Control; this.MenuGroupAddChild.Size = new Size(297, 22); this.MenuGroupAddChild.Text = "Добавить дочернюю группу"; this.MenuGroupAddChild.Click += new EventHandler(this.MenuGroupAddChild_Click); this.MenuGroupRename.Name = "MenuGroupRename"; this.MenuGroupRename.ShortcutKeys = Keys.Return | Keys.Control; this.MenuGroupRename.Size = new Size(297, 22); this.MenuGroupRename.Text = "Переименовать"; this.MenuGroupRename.Click += new EventHandler(this.MenuGroupRename_Click); this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new Size(294, 6); this.MenuGroupRemove.Name = "MenuGroupRemove"; this.MenuGroupRemove.ShortcutKeys = Keys.Delete | Keys.Control; this.MenuGroupRemove.Size = new Size(297, 22); this.MenuGroupRemove.Text = "Удалить"; this.MenuGroupRemove.Click += new EventHandler(this.MenuGroupRemove_Click); this.toolStripSeparator8.Name = "toolStripSeparator8"; this.toolStripSeparator8.Size = new Size(294, 6); this.MenuGroupMove.Name = "MenuGroupMove"; this.MenuGroupMove.ShortcutKeys = Keys.F6; this.MenuGroupMove.Size = new Size(297, 22); this.MenuGroupMove.Text = "Переместить в группу"; this.MenuGroupMove.Click += new EventHandler(this.MenuGroupMove_Click); this.MenuGroupSetMain.Name = "MenuGroupSetMain"; this.MenuGroupSetMain.ShortcutKeys = Keys.M | Keys.Shift | Keys.Control; this.MenuGroupSetMain.Size = new Size(297, 22); this.MenuGroupSetMain.Text = "Сделать группу основной"; this.MenuGroupSetMain.Click += new EventHandler(this.MenuGroupSetMain_Click); this.imageList1.ImageStream = (ImageListStreamer)componentResourceManager.GetObject("imageList1.ImageStream"); this.imageList1.TransparentColor = Color.Magenta; this.imageList1.Images.SetKeyName(0, "Folder.ico"); this.colnumval.Caption = "Число"; this.colnumval.FieldName = "numval"; this.colnumval.Name = "colnumval"; this.colnumval.Visible = true; this.colnumval.VisibleIndex = 3; this.colintval.Caption = "Целое число"; this.colintval.FieldName = "intval"; this.colintval.Name = "colintval"; this.colintval.Visible = true; this.colintval.VisibleIndex = 4; this.colstrval.Caption = "Строка"; this.colstrval.FieldName = "strval"; this.colstrval.Name = "colstrval"; this.colstrval.Visible = true; this.colstrval.VisibleIndex = 5; this.AutoScaleDimensions = new SizeF(6f, 13f); this.AutoScaleMode = AutoScaleMode.Font; this.Controls.Add((Control)this.gridControlAddClassification); this.Controls.Add((Control)this.splitterControl1); this.Controls.Add((Control)this.treeListGroup); this.Controls.Add((Control)this.panelDialog); this.Controls.Add((Control)this.panelEdit); this.Name = "AddClassification"; this.Size = new Size(847, 484); this.Text = "Доп. классификация"; this.FormClosing += new FormClosing(this.AddClassification_FormClosing); this.panelDialog.ResumeLayout(false); this.panelEdit.ResumeLayout(false); this.gridControlAddClassification.EndInit(); this.MenuItem.ResumeLayout(false); this.ds.EndInit(); this.gridViewItem.EndInit(); this.repositoryItemMemoExEdit1.EndInit(); this.repositoryItemPictureEdit1.EndInit(); this.repositoryItemCheckEdit1.EndInit(); this.repositoryItemCheckEdit2.EndInit(); this.treeListGroup.EndInit(); this.MenuGroup.ResumeLayout(false); this.ResumeLayout(false); }
/// <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; }
public static RepositoryItemMemoExEdit CotPLMultiLineEdit(GridView view, GridColumn Column, string ColumnField) { HelpGridColumn.SetHorzAlignment(Column, HorzAlignment.Near); RepositoryItemTextEdit editorForDisplay = new RepositoryItemTextEdit(); RepositoryItemMemoExEdit editorForEditing = new RepositoryItemMemoExEdit(); view.Columns[ColumnField].ColumnEdit = editorForDisplay; view.CustomRowCellEditForEditing += delegate(object sender, CustomRowCellEditEventArgs e) { if (e.Column.FieldName == ColumnField) { e.RepositoryItem = editorForEditing; } }; return editorForEditing; }