コード例 #1
0
    protected void drp_city_SelectedIndexChanged(object sender, EventArgs e)
    {
        drp_clg.Items.Clear();
        drp_clg.Items.Add(new ListItem("Select College", "0", true));
        DataSet ds = bl.get_selected_clg(Convert.ToInt32(drp_city.SelectedValue));

        ds.Tables[0].DefaultView.Sort = "clg_name";
        ds.Tables[0].Columns.Add("clg_name_code");
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            ds.Tables[0].Rows[i][4] = ds.Tables[0].Rows[i][3] + " (" + ds.Tables[0].Rows[i][2] + ")";
        }
        drp_clg.DataSource     = ds.Tables[0];
        drp_clg.DataTextField  = "clg_name_code";
        drp_clg.DataValueField = "clg_id";
        drp_clg.DataBind();
        ds.Clear();
    }