public void CascadingDropdown() { companyDropDownList.DataSource = stockInManager.GetAllCompany(); companyDropDownList.DataBind(); companyDropDownList.Items.Insert(0, new ListItem("Select Company", "0")); itemDropDownList.Items.Insert(0, new ListItem("Select Item", "0")); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { companyDropDownList.DataTextField = "CompanyName"; companyDropDownList.DataValueField = "CompanyID"; companyDropDownList.DataSource = stockInManager.GetAllCompany(); companyDropDownList.DataBind(); companyDropDownList.Items.Insert(0, new ListItem("<Select Subject>", "0")); } }
public void Company() { // List<StockinView> stockinViews = aStockInManager.StockWithCompany(); List <Company> stockinViews = aStockInManager.GetAllCompany(); /// StockinView defauStockinView = new StockinView(); Company defauStockinView = new Company(); defauStockinView.CompanyId = -1; defauStockinView.CompanyName = "--Select--"; stockinViews.Insert(0, defauStockinView); companyComboBox.DataSource = stockinViews; companyComboBox.DisplayMember = "CompanyName"; companyComboBox.ValueMember = "CompanyId"; }