Databases Reference
In-Depth Information
public partial class RegionEditField : FieldTemplateUserControl
{
private FieldTemplateUserControl countryFieldTemplate;
public override Control DataControl
{
get { return this.textBox; }
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.textBox.ToolTip = this.Column.Description;
this.SetUpValidator(this.requiredFieldValidator);
this.SetUpValidator(this.dynamicValidator);
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.countryFieldTemplate = this.FindOtherFieldTemplate(“Country”);
var countryTextBox = (TextBox)this.countryFieldTemplate.DataControl;
countryTextBox.AutoPostBack = true;
countryTextBox.TextChanged += CountryTextBox_TextChanged;
}
protected override void OnDataBinding(EventArgs e)
{
base.OnDataBinding(e);
string country = this.countryFieldTemplate.FieldValueEditString;
this.autoCompleteExtender.ContextKey = country;
}
protected override void ExtractValues(IOrderedDictionary dictionary)
{
dictionary[this.Column.Name] = this.ConvertEditedValue(this.textBox.Text);
}
private void CountryTextBox_TextChanged(object sender, EventArgs args)
{
var countryTextBox = (TextBox)sender;
this.autoCompleteExtender.ContextKey = countryTextBox.Text;
}
}
}
Search WWH ::




Custom Search