protected void Page_Load(object sender, EventArgs e) { DataModelControlHelper.RenderControls(leftRegion, SharedFields, SharedFieldsBehaviors, string.Empty); DataModelControlHelper.RenderControls(rightRegion, ExtensionFields, null, string.Empty); string[] customerList = new string[] { "Shipper", "Consignee", "NotifyPart" }; Customer[] customers = BasicInformationProxy.FindCustomersByName(string.Empty); foreach (string customerField in customerList) { DropDownList list = DataModelControlHelper.GetControl(leftRegion, customerField) as DropDownList; list.DataTextField = "Name"; list.DataValueField = "Id"; list.DataSource = customers; list.DataBind(); if (list.Items.Count > 0) { list.Items.Insert(0, new ListItem(string.Empty, string.Empty)); } } if (!Page.IsPostBack) { InitialControls(); } }
private void Search() { Customer[] customers = BasicInformationProxy.FindCustomersByName(this.txtSCustomerName.Text.Trim()); if (customers.Length == 0) { customers = new Customer[] { new Customer() } } ; this.gridCustomer.DataSource = customers; this.gridCustomer.DataBind(); }