/// <summary> /// Populate Static Controls /// </summary> private void PopulateStaticControls() { // Load the Classes Dropdown Facade.ITrailer facResource = new Facade.Resource(); DataSet dsTrailerTypes = facResource.GetAllTrailerTypes(); cboTrailerType.DataSource = dsTrailerTypes; cboTrailerType.DataTextField = "Description"; cboTrailerType.DataValueField = "TrailerTypeId"; cboTrailerType.DataBind(); cboTrailerType.Items.Insert(0, new ListItem("--- [ Please Select ] ---", "")); // Load the Manufacturers dropdown DataSet dsTrailerManufacturers = facResource.GetAllTrailerManufacturers(); cboTrailerManufacturer.DataSource = dsTrailerManufacturers; cboTrailerManufacturer.DataTextField = "Description"; cboTrailerManufacturer.DataValueField = "TrailerManufacturerId"; cboTrailerManufacturer.DataBind(); cboTrailerManufacturer.Items.Insert(0, new ListItem("--- [ Please Select ] ---", "")); // Load the Trailer Description dropdown cboTrailerDescription.DataSource = facResource.GetAllTrailerDescriptions(); cboTrailerDescription.DataTextField = "Description"; cboTrailerDescription.DataValueField = "TrailerDescriptionId"; cboTrailerDescription.DataBind(); cboTrailerDescription.Items.Insert(0, new ListItem("--- [ Please Select ] ---", "")); Facade.IControlArea facControlArea = new Facade.Traffic(); cboControlArea.DataSource = facControlArea.GetAll(); cboControlArea.DataTextField = "Description"; cboControlArea.DataValueField = "ControlAreaId"; cboControlArea.DataBind(); cboControlArea.Items.Insert(0, new ListItem("--- [ Please Select ] ---", "")); Facade.ITrafficArea facTrafficArea = (Facade.ITrafficArea)facControlArea; cboTrafficArea.DataSource = facTrafficArea.GetAll(); cboTrafficArea.DataTextField = "Description"; cboTrafficArea.DataValueField = "TrafficAreaId"; cboTrafficArea.DataBind(); cboTrafficArea.Items.Insert(0, new ListItem("--- [ Please Select ] ---", "")); }
void grdTrailerTypes_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { Facade.ITrailer facTrailer = new Facade.Resource(); this.grdTrailerTypes.DataSource = facTrailer.GetAllTrailerTypes(); }