Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/17/13 16:50:38 (12 years ago)
Author:
mkommend
Message:

#1734: Updated save file dialog and ColumnGroupView in the data importer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Data/View/ColumnGroupView.cs

    r9629 r9640  
    4141      this.splitContainer1.Panel2.Controls.Add(txtColumnName);
    4242      txtColumnName.Visible = false;
    43       txtColumnName.Leave += new EventHandler(txtColumnName_Leave);
     43      txtColumnName.Validated += new EventHandler(txtColumnName_Validated);
    4444      txtColumnName.KeyDown += new KeyEventHandler(txtColumnName_KeyDown);
    4545
     
    589589
    590590    #region txtColumnName event handler
    591     private void txtColumnName_Leave(object source, EventArgs e) {
     591    private void txtColumnName_Validated(object source, EventArgs e) {
    592592      if (!this.txtColumnName.Visible) return;
    593593      this.txtColumnName.Visible = false;
     
    599599
    600600    private void txtColumnName_KeyDown(object source, KeyEventArgs e) {
    601       if (e.KeyCode != Keys.Enter && e.KeyCode != Keys.Escape)
    602         return;
    603       if (e.KeyCode == Keys.Enter) {
     601      if (e.KeyCode == Keys.Escape) {
    604602        DataGridView.HitTestInfo h = this.dataGridView.HitTest(txtColumnName.Location.X, txtColumnName.Location.Y);
    605         if (txtColumnName.Text != this.ColumnGroup.GetColumn(h.ColumnIndex).Name)
    606           this.commandChain.Add(new RenameColumnCommand(DataSet, this.ColumnGroup.Name, h.ColumnIndex, txtColumnName.Text));
    607       }
    608       this.txtColumnName.Visible = false;
     603        this.txtColumnName.Text = this.ColumnGroup.GetColumn(h.ColumnIndex).Name;
     604        dataGridView.Select();
     605      } else if (e.KeyCode == Keys.Enter)
     606        dataGridView.Select();
    609607    }
    610608    #endregion
Note: See TracChangeset for help on using the changeset viewer.