Exemple #1
0
 public void state()
 {
     DropDownList_state.DataSource     = bs.bs_state();
     DropDownList_state.DataTextField  = "STATE";
     DropDownList_state.DataValueField = "SID";
     DropDownList_state.DataBind();
 }
Exemple #2
0
        protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
        {
            GridView1.EditIndex = e.NewEditIndex;
            Bind();

            HiddenField     gen = GridView1.Rows[e.NewEditIndex].FindControl("HiddenField1") as HiddenField;
            RadioButtonList rd  = GridView1.Rows[e.NewEditIndex].FindControl("RadioButtonList1") as RadioButtonList;

            rd.SelectedValue = gen.Value;

            HiddenField  age   = GridView1.Rows[e.NewEditIndex].FindControl("HiddenField2") as HiddenField;
            DropDownList ddage = GridView1.Rows[e.NewEditIndex].FindControl("DropDownList1") as DropDownList;

            ddage.SelectedValue = age.Value;

            HiddenField  st   = GridView1.Rows[e.NewEditIndex].FindControl("HiddenField3") as HiddenField;
            DropDownList ddst = GridView1.Rows[e.NewEditIndex].FindControl("DropDownList_state") as DropDownList;


            ddst.DataSource     = bs.bs_state();
            ddst.DataTextField  = "STATE";
            ddst.DataValueField = "SID";
            ddst.DataBind();

            HiddenField  ct   = GridView1.Rows[e.NewEditIndex].FindControl("HiddenField4") as HiddenField;
            DropDownList ddct = GridView1.Rows[e.NewEditIndex].FindControl("DropDownList_city") as DropDownList;

            int id = int.Parse(ddst.SelectedItem.Value);

            bs.sid = id;

            ddct.DataSource     = bs.bs_city(bs);
            ddct.DataTextField  = "CITY";
            ddct.DataValueField = "CITY";
            ddct.DataBind();
        }