private void SetHeaderText(GridColumnDescriptorCollection columns) { foreach (GridColumnDescriptor col in columns) { Regex rex = new Regex(@"\p{Lu}"); int index = rex.Match(col.MappingName.Substring(1)).Index; string name = ""; while (index > 0) { name += col.MappingName.Substring(0, index + 1) + " "; string secondName = col.MappingName.Substring(index + 1); index = rex.Match(secondName.Substring(1)).Index; while (index > 0) { name += secondName.Substring(0, index + 1) + " "; index = rex.Match(col.MappingName.Substring(name.Replace(" ", "").Length).Substring(1)).Index; } } name += col.MappingName.Substring(name.Replace(" ", "").Length); col.HeaderText = name; } }
public FormatColumnsDialog(GridGroupingControl grid) { // // Required for Windows Form Designer support // InitializeComponent(); this.groupingGrid = grid; descColl = new GridColumnDescriptorCollection(); for (int i = 1; i < this.groupingGrid.TableDescriptor.VisibleColumns.Count; i++) { GridVisibleColumnDescriptor col = this.groupingGrid.TableDescriptor.VisibleColumns[i]; if (col != null) { this.comboBox1.Items.Add(col.Name); } } this.listBox1.SelectedIndexChanged += new EventHandler(listBox1_SelectedIndexChanged); this.colorPickerButton1.ColorSelected += new EventHandler(colorPickerButton1_ColorSelected); this.colorPickerButton2.ColorSelected += new EventHandler(colorPickerButton2_ColorSelected); // // TODO: Add any constructor code after InitializeComponent call // }