- Timestamp:
- 06/13/13 20:54:50 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Data/View/ColumnGroupView.cs
r9615 r9627 333 333 this.commandChain.Add(new SortCommand(DataSet, this.ColumnGroup.Name, 334 334 e.ColumnIndex, (Control.ModifierKeys & Keys.Control) == Keys.Control)); 335 //this.UpdateSortGlyph();336 //this.dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);337 //UpdateStateInformation();338 335 } 339 336 } … … 497 494 498 495 private string ToExcelColumnIndex(int index) { 499 //if (symb.Length == 1) { // 'A' .. 'Z'500 // return TryTranslateColumnIndexDigit(symb[0], out columnIndex);501 //} else if (symb.Length == 2) { // 'AA' ... 'ZZ'502 // bool ok;503 // int d0, d1;504 // ok = TryTranslateColumnIndexDigit(symb[0], out d1) & TryTranslateColumnIndexDigit(symb[1], out d0);505 // columnIndex = (d1 + 1) * 26 + d0;506 // return ok;507 //} else {508 // columnIndex = 0;509 // return false;510 //}511 496 #region digits 512 497 var digits = new char[] { … … 553 538 #region DataGridView virtual mode event handler 554 539 private void dataGridView_CellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e) { 540 if (!ColumnGroup.Columns.Any()) return; 555 541 e.Value = ColumnGroup.Columns.ElementAt(e.ColumnIndex).GetValue(e.RowIndex); 556 542 } … … 603 589 #region txtColumnName event handler 604 590 private void txtColumnName_Leave(object source, EventArgs e) { 591 if (!this.txtColumnName.Visible) return; 605 592 this.txtColumnName.Visible = false; 593 594 DataGridView.HitTestInfo h = this.dataGridView.HitTest(txtColumnName.Location.X, txtColumnName.Location.Y); 595 if (txtColumnName.Text != this.ColumnGroup.GetColumn(h.ColumnIndex).Name) 596 this.commandChain.Add(new RenameColumnCommand(DataSet, this.ColumnGroup.Name, h.ColumnIndex, txtColumnName.Text)); 606 597 } 607 598 … … 611 602 if (e.KeyCode == Keys.Enter) { 612 603 DataGridView.HitTestInfo h = this.dataGridView.HitTest(txtColumnName.Location.X, txtColumnName.Location.Y); 613 this.commandChain.Add(new RenameColumnCommand(DataSet, this.ColumnGroup.Name, h.ColumnIndex, txtColumnName.Text)); 604 if (txtColumnName.Text != this.ColumnGroup.GetColumn(h.ColumnIndex).Name) 605 this.commandChain.Add(new RenameColumnCommand(DataSet, this.ColumnGroup.Name, h.ColumnIndex, txtColumnName.Text)); 614 606 } 615 607 this.txtColumnName.Visible = false; … … 653 645 654 646 private bool CheckIfNewColumnGroupNameIsAllowed(string newName) { 655 return !this.DataSet.ColumnGroups.Any(cg => cg.Name == newName);647 return this.DataSet.ColumnGroups.All(cg => cg.Name != newName); 656 648 } 657 649 #endregion
Note: See TracChangeset
for help on using the changeset viewer.