protected void DrpApplications_SelectedIndexChanged(object sender, EventArgs e) { localhost1.WebService1 obj = new localhost1.WebService1(); DropDownList drp = sender as DropDownList; if (drp != null) { int id = Convert.ToInt32(drp.SelectedItem.Value); int GridViewItemIndex = ((GridViewRow)drp.NamingContainer).RowIndex; //DropDownList Drpapptype = (DropDownList)RptAddefforts.Items[RepeaterItemIndex].FindControl("DrpApplicationType"); DropDownList Drpapptype = (DropDownList)GridView1.FindControl("DropDownList4"); //DropDownList Drpvendor = (DropDownList)RptAddefforts.Items[RepeaterItemIndex].FindControl("DrpVendor"); if (Drpapptype != null) { DataTable dtapplications = obj.BindCascadingDropList("applications", id); if (dtapplications != null && dtapplications.Rows.Count > 0) { Drpapptype.SelectedIndex = Drpapptype.Items.IndexOf(Drpapptype.Items.FindByValue(Convert.ToString(dtapplications.Rows[0]["AppCat_id"]))); // Drpvendor.SelectedIndex = Drpvendor.Items.IndexOf(Drpvendor.Items.FindByValue(Convert.ToString(dtapplications.Rows[0]["AppVendor_Id"]))); Drpapptype.Enabled = false; // Drpvendor.Enabled = false; } } } }
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { int ddl = Convert.ToInt32(((DropDownList)GridView1.FindControl("ddltinhtrang")).SelectedValue); if (ddl == 0) { GridView1.Rows[e.RowIndex].Cells[6].Text = "Chờ xác nhận đơn hàng"; } else if (ddl == 1) { GridView1.Rows[e.RowIndex].Cells[6].Text = "Đang đi lấy hàng về kho"; } else if (ddl == 2) { GridView1.Rows[e.RowIndex].Cells[6].Text = "Đang vận chuyển"; } else if (ddl == 3) { GridView1.Rows[e.RowIndex].Cells[6].Text = "Đã vận chuyển đến kho"; } else if (ddl == 4) { GridView1.Rows[e.RowIndex].Cells[6].Text = "Sẵn hàng giao hàng"; } else { GridView1.Rows[e.RowIndex].Cells[6].Text = "Giao hàng thành công"; } }
protected void DrpTicketType_SelectedIndexChanged(object sender, EventArgs e) { localhost1.WebService1 obj = new localhost1.WebService1(); DropDownList drp = sender as DropDownList; if (drp != null) { int id = Convert.ToInt32(drp.SelectedItem.Value); int GridViewItemIndex = ((GridViewRow)drp.NamingContainer).RowIndex; // DropDownList Drpclass = (DropDownList)GridView1.Items[RepeaterItemIndex].FindControl("DrpClassification"); DropDownList Drpclass = (DropDownList)GridView1.FindControl("DropDownList2"); if (Drpclass != null) { DataTable DtClassfication = obj.BindCascadingDropList("classification", id); if (DtClassfication != null && DtClassfication.Rows.Count > 0) { Drpclass.Items.Clear(); Drpclass.DataSource = DtClassfication; Drpclass.DataTextField = "TClassification_Name"; Drpclass.DataValueField = "TClassification_Id"; Drpclass.DataBind(); } } } }
public void initType() { DropDownList ddl = (DropDownList)GridView1.FindControl("typeList"); ddl.DataSource = Util.goodsType; ddl.DataBind(); }
protected void DropDownList7_SelectedIndexChanged(object sender, EventArgs e) { string str = ((DropDownList)GridView1.FindControl("DropDownList7")).SelectedValue; this.SqlDataSource2.SelectCommand = classcommand + " where Courseid=" + str + ""; ((DropDownList)GridView1.FindControl("DorpDownList4")).DataBind(); }
protected void Emitir_Click(object sender, EventArgs e) { //Store Procedure TresAmigosWebService ws = new TresAmigosWebService(); //DateTime fecha = Convert.ToDateTime(from_date.Text); string EmisorNombre = NombreEmisor.Text; string EmisorEail = EmailEmisor.Text; string EmisorUbicacion = UbicacionEmisor.Text; string EmisorTelefono = TelefonoEmisor.Text; string Receptornombre = NombreReceptor.Text; string ReceptorMail = EmailReceptor.Text; string ReceptorUbicacion = UbicacionReceptor.Text; string ReceptorTelefono = TelefonoReceptor.Text; string Pagos = MetodoPago.SelectedValue; int cantidad = 0; int codigo; string name = ""; codigo = Convert.ToInt32(GridView1.FindControl("TextBox2")); cantidad = Convert.ToInt32(GridView1.FindControl("TextBox")); ws.AgregarFactura(1, "", Pagos, EmisorNombre, Convert.ToInt32(cantidad), codigo); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "AddToCart") { for (int i = 0; i < GridView1.Rows.Count; i++) { Calendar cal = (Calendar)GridView1.FindControl("Cal1"); cal.Visible = true; } // Retrieve the row index stored in the // CommandArgument property. int index = Convert.ToInt32(e.CommandArgument); // Retrieve the row that contains the button // from the Rows collection. GridViewRow row = GridView1.Rows[index]; // Add code here to add the item to the shopping cart. } }
public void LoadGrivData(int teachID) { String Date = Calendar1.SelectedDate.ToString("yyyy-MM-dd"); int select = Convert.ToInt32(drClass.SelectedValue); int slotID = Convert.ToInt32(DropDownList1.SelectedValue); GridView1.DataSource = DAO.GetListAttenByClassid(select, teachID, Date, slotID); GridView1.DataBind(); List <Attendance> l = new List <Attendance>(); foreach (Attendance row in l) { if (row.Status == true) { RadioButton rPRE = (RadioButton)GridView1.FindControl("RadioButton1"); rPRE.Checked = true; } else { RadioButton rAP = (RadioButton)GridView1.FindControl("RadioButton2"); rAP.Checked = true; } } }