void BindClassListByStreamAndQual() { DropDownList_Class.Items.Clear(); DropDownList_Class.DataSource = QualClassManagement.GetInstance.GetClassListByStreamAndQual(int.Parse(DropDownList_Course.SelectedValue), int.Parse(DropDownList_Stream.SelectedValue)); DropDownList_Class.DataTextField = QualClassManagement.GetInstance.DisplayMember; DropDownList_Class.DataValueField = QualClassManagement.GetInstance.ValueMember; DropDownList_Class.DataBind(); DropDownList_Class.Items.Insert(0, MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Int32 currentyear = Convert.ToInt32(DateTime.Now.Year); for (int i = 11; i >= 0; i--) { DataBind(); DropDownList_Year.Items.Insert(0, Convert.ToString(currentyear - i)); DropDownList_Year.Items[0].Value = Convert.ToString(currentyear - i); DataBind(); } DropDownList_Year.DataBind(); DropDownList_Year.Items.Insert(0, "Select Year"); DropDownList_Year.Items[0].Value = ""; DropDownList_Year.SelectedIndex = 0; DropDownList_Class.DataBind(); DropDownList_Class.Items.Insert(0, "Select Class"); DropDownList_Class.Items[0].Value = ""; DropDownList_Class.SelectedIndex = 0; DropDownList_Driver.DataBind(); DropDownList_Driver.Items.Insert(0, "Select Driver"); DropDownList_Driver.Items[0].Value = ""; DropDownList_Driver.SelectedIndex = 0; DropDownList_Officer.DataBind(); DropDownList_Officer.Items.Insert(0, "Select Officer"); DropDownList_Officer.Items[0].Value = ""; DropDownList_Officer.SelectedIndex = 0; DropDownList_ManufacturerId.DataBind(); DropDownList_ManufacturerId.Items.Insert(0, "Select Manufacturer"); DropDownList_ManufacturerId.Items[0].Value = ""; DropDownList_ManufacturerId.SelectedIndex = 0; } }