Beispiel #1
0
        private void bEdit_Click(object sender, EventArgs e)
        {
            if (this.olvCustomColumns.SelectedObject == null)
            {
                return;
            }

            int index = this.olvCustomColumns.SelectedIndex;

            KeyValuePair <string, string> selectedItem = (KeyValuePair <string, string>) this.olvCustomColumns.SelectedObject;

            using (AddCustomColumnDialog dialog = new AddCustomColumnDialog())
            {
                dialog.ColumnName  = selectedItem.Key;
                dialog.ColumnValue = selectedItem.Value;
                dialog.Text        = "Edit " + selectedItem.Key;

                if (dialog.ShowDialog(this) == DialogResult.OK)
                {
                    this.cachedCustomColumns.Remove(selectedItem.Key);
                    this.cachedCustomColumns[dialog.ColumnName] = dialog.ColumnValue;
                    this.olvCustomColumns.SetObjects(this.cachedCustomColumns);
                    this.olvCustomColumns.SelectedIndex = index;
                    this.CustomColumnsChanged           = true;
                }
            }
        }
Beispiel #2
0
 private void bAddCustomColumn_Click(object sender, EventArgs e)
 {
     using (AddCustomColumnDialog dialog = new AddCustomColumnDialog())
     {
         if (dialog.ShowDialog(this) == DialogResult.OK)
         {
             this.cachedCustomColumns[dialog.ColumnName] = dialog.ColumnValue;
             this.olvCustomColumns.SetObjects(this.cachedCustomColumns);
             this.CustomColumnsChanged = true;
         }
     }
 }