protected virtual void OnAutoFill(AutoFillEventArgs e) { var handler = this.AutoFill; if (handler != null) { handler(this, e); } }
protected void OnPreLoad(object sender, EventArgs e) { if (this.Page.IsPostBack == true) { var fillValue = this.Context.Request.Form[String.Concat(this.UniqueID, "_HiddenField")]; if (String.IsNullOrWhiteSpace(fillValue) == false) { var args = new AutoFillEventArgs(fillValue); this.OnAutoFill(args); foreach (var key in args.Results.Keys.OfType<String>()) { this.Items.Add(new ListItem(args.Results[key], key)); } var selectedValue = this.Context.Request.Form[this.UniqueID]; this.SelectedIndex = this.Items.IndexOf(this.Items.FindByValue(selectedValue)); } } }
void ICallbackEventHandler.RaiseCallbackEvent(String eventArgument) { var args = new AutoFillEventArgs(eventArgument); this.OnAutoFill(args); this.Context.Items["Results"] = args.Results; }