/// <summary> /// Event from clicking on the Data Source "..." button /// </summary> /// <param name="sender">Object that fired the event</param> /// <param name="e">.NET supplied event parameters</param> protected virtual void btnDataSource_Click(object sender, EventArgs e) { LegalValuesDialog sourceTableDialog = new LegalValuesDialog((TableBasedDropDownField)this.Field, this.MainForm, txtFieldName.Text, this.page); DialogResult result = sourceTableDialog.ShowDialog(); if (result == DialogResult.OK) { if (!string.IsNullOrEmpty(sourceTableDialog.SourceTableName) && !string.IsNullOrEmpty(sourceTableDialog.TextColumnName)) { txtDataSource.Text = sourceTableDialog.SourceTableName + " :: " + sourceTableDialog.TextColumnName; } else if (string.IsNullOrEmpty(sourceTableDialog.SourceTableName) && string.IsNullOrEmpty(sourceTableDialog.TextColumnName)) { txtDataSource.Text = string.Empty; field.SourceTableName = string.Empty; field.TextColumnName = string.Empty; } else { txtDataSource.Text = sourceTableDialog.SourceTableName + " :: " + sourceTableDialog.TextColumnName; } this.sourceTableName = sourceTableDialog.SourceTableName; this.textColumnName = sourceTableDialog.TextColumnName; btnOk.Enabled = true; } }