public void InitializeTable(string[] patterns, string[] categories) { this._templateTable.ColumnModel = new ColumnModel(); this._templateTable.TableModel = new TableModel(); // 0: Name ComboBoxColumn patternCol = new ComboBoxColumn("Pattern"); ComboBoxCellEditor patternEditor = new ComboBoxCellEditor(); patternEditor.TextChanged += new EventHandler(patternEditor_TextChanged); patternEditor.DropDownStyle = DropDownStyle.DropDown; // patternEditor.Items.AddRange(patterns); patternEditor.AutCompleteAddItems(patterns, AutoCompleteMode.Suggest); patternCol.Editor = patternEditor; patternCol.Editable = true; this._templateTable.ColumnModel.Columns.Add(patternCol); // 1: Type ComboBoxColumn typeCol = new ComboBoxColumn("Type"); ComboBoxCellEditor typeEditor = new ComboBoxCellEditor(); typeEditor.Items.Add(CategoryItemType.String.ToString()); typeEditor.Items.Add(CategoryItemType.WildCard.ToString()); typeEditor.Items.Add(CategoryItemType.Regex.ToString()); typeCol.Editor = typeEditor; typeCol.Editable = true; this._templateTable.ColumnModel.Columns.Add(typeCol); // 2: Category ComboBoxColumn categoryCol = new ComboBoxColumn("Category"); ComboBoxCellEditor categoryEditor = new ComboBoxCellEditor(); categoryEditor.DropDownStyle = DropDownStyle.DropDown; // categoryEditor.Items.AddRange(categories); categoryEditor.AutCompleteAddItems(categories, AutoCompleteMode.SuggestAppend); categoryCol.Editor = categoryEditor; categoryCol.Editable = true; this._templateTable.ColumnModel.Columns.Add(categoryCol); AdjustColumnWidth(); this._templateTable.BeginEditing += new XPTable.Events.CellEditEventHandler(_templateTable_BeginEditing); this._templateTable.AfterEditing += new XPTable.Events.CellEditEventHandler(_templateTable_AfterEditing); this._templateTable.MouseDown += new System.Windows.Forms.MouseEventHandler(this._templateTable_MouseDown); this._templateTable.AlternatingRowColor = Color.LightBlue; }
private void RefreshAreaComboList() { ComboBoxCellEditor editor = new ComboBoxCellEditor(); editor.DropDownStyle = DropDownStyle.DropDownList; editor.Items.AddRange(GetAreasList()); columnModelFrames.Columns[0].Editor = editor; }
private void DoBinding2() { ImageList ilist = GetImageList(); Table table = this.table; // The Table control on a form - already initialised table.BeginUpdate(); table.SelectionStyle = SelectionStyle.ListView; table.EnableWordWrap = false; // If false, then Cell.WordWrap is ignored table.GridLines = GridLines.None; int h = table.RowHeight; table.DataMember = ""; MyBinder binder = new MyBinder(ilist, this.Font); table.DataSourceColumnBinder = binder; table.DataSource = GetDataSource(); //table.ColumnModel.Columns[0].Width = 60; ////table.ColumnModel.Columns[1].Width = 40; //table.ColumnModel.Columns[2].Width = 120; //table.ColumnModel.Columns[3].Width = 120; //table.ColumnModel.Columns[4].Width = 60; table.ColumnModel.Columns["name"].Width = 60; ComboBoxColumn combo = table.ColumnModel.Columns["name"] as ComboBoxColumn; if (combo != null) { ComboBoxCellEditor editor = new ComboBoxCellEditor(); //editor.SelectedIndexChanged += new EventHandler(editor_SelectedIndexChanged); //editor.EndEdit += new XPTable.Events.CellEditEventHandler(editor_EndEdit); combo.Editor = editor; } //table.ColumnModel.Columns[1].Width = 40; table.ColumnModel.Columns["date"].Width = 120; table.ColumnModel.Columns["colour"].Width = 120; table.ColumnModel.Columns["like them?"].Width = 60; table.BeginEditing += new XPTable.Events.CellEditEventHandler(table_BeginEditing); table.EditingStopped += new XPTable.Events.CellEditEventHandler(table_EditingStopped); this.table.EndUpdate(); this.table.TableModel.RowHeight = 40; }
/// <summary> /// Initializes a new instance of the <see cref="XSLStyleEdit"/> class. /// </summary> /// <remarks>Documented by Dev05, 2007-10-30</remarks> public XSLStyleEdit() { InitializeComponent(); tableXSL.HeaderRenderer = new XPTable.Renderers.GradientHeaderRenderer(); //manually localized resource strings tableXSL.NoItemsText = Properties.Resources.STYLEEDIT_NOITEMSTEXT; textColumnElementName.Text = Properties.Resources.STYLEEDIT_COLUMN_ELEMENT; colorColumnColor.Text = Properties.Resources.STYLEEDIT_COLUMN_COLOR; colorColumnBackColor.Text = Properties.Resources.STYLEEDIT_COLUMN_BACKCOLOR; buttonColumnFont.Text = Properties.Resources.STYLEEDIT_COLUMN_FONT; comboBoxColumnHAlign.Text = Properties.Resources.STYLEEDIT_COLUMN_HALIGN; comboBoxColumnVAlign.Text = Properties.Resources.STYLEEDIT_COLUMN_VALIGN; horizontalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.HorizontalAlignment.None)); horizontalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.HorizontalAlignment.Left)); horizontalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.HorizontalAlignment.Center)); horizontalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.HorizontalAlignment.Right)); ComboBoxCellEditor horizontalEditor = new ComboBoxCellEditor(); horizontalEditor.DropDownStyle = DropDownStyle.DropDownList; horizontalEditor.Items.AddRange(horizontalElements.ToArray()); comboBoxColumnHAlign.Editor = horizontalEditor; verticalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.VerticalAlignment.None)); verticalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.VerticalAlignment.Top)); verticalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.VerticalAlignment.Middle)); verticalElements.Add(new EnumLocalizer(Properties.Resources.ResourceManager, MLifter.DAL.Interfaces.VerticalAlignment.Bottom)); ComboBoxCellEditor verticalEditor = new ComboBoxCellEditor(); verticalEditor.DropDownStyle = DropDownStyle.DropDownList; verticalEditor.Items.AddRange(verticalElements.ToArray()); comboBoxColumnVAlign.Editor = verticalEditor; textBoxFile.ScrollBars = RichTextBoxScrollBars.Both; textBoxFile.WordWrap = false; textBoxFile.Seperators.Add(' '); textBoxFile.Seperators.Add('\t'); textBoxFile.Seperators.Add('\r'); textBoxFile.Seperators.Add('\n'); textBoxFile.Seperators.Add(';'); textBoxFile.Seperators.Add('='); textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor("body", Color.Red, null, DescriptorType.Word, DescriptorRecognition.WholeWord, false)); textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor("button", Color.Red, null, DescriptorType.Word, DescriptorRecognition.WholeWord, false)); textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor("a", Color.Red, null, DescriptorType.Word, DescriptorRecognition.WholeWord, false)); textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor("a:", Color.Red, null, DescriptorType.Word, DescriptorRecognition.StartsWith, false)); textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor("div.", Color.Red, null, DescriptorType.Word, DescriptorRecognition.StartsWith, false)); textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor(".", Color.Red, null, DescriptorType.Word, DescriptorRecognition.StartsWith, false)); textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor("#", Color.Cyan, null, DescriptorType.Word, DescriptorRecognition.StartsWith, false)); textBoxFile.HighlightDescriptors.Add(new HighlightDescriptor(":", Color.DarkBlue, null, DescriptorType.Word, DescriptorRecognition.Contains, false)); }