protected void companyDropDownList_SelectedIndexChanged(object sender, EventArgs e) { int companyId = Convert.ToInt32(companyDropDownList.SelectedValue); itemDropDownList.DataSource = stockInManager.GetAllItemsByCompanyId(companyId); itemDropDownList.DataTextField = "ItemName"; itemDropDownList.DataValueField = "Id"; itemDropDownList.DataBind(); itemDropDownList.Items.Insert(0, new ListItem("Select", "0")); }
protected void companyDropDownList_SelectedIndexChanged(object sender, EventArgs e) { if (companyDropDownList.SelectedIndex > 0) { int id = Convert.ToInt32(companyDropDownList.SelectedValue); itemDropDownList.DataSource = stockInManager.GetAllItemsByCompanyId(id); itemDropDownList.DataTextField = "ItemName"; itemDropDownList.DataValueField = "Id"; itemDropDownList.DataBind(); itemDropDownList.Items.Insert(0, new ListItem("Select item", "0")); } else { reorderLevelTextBox.Text = ""; availableQuantityTextBox.Text = ""; stockInQuantityTextBox.Text = ""; messageLabel.Text = "Does't Select Any Item"; stockInQuantityTextBox.Enabled = false; } }