Gautam Buddha Temple Varanasi,Varanasi - Buddhist Pilgrimage

Saturday, September 11, 2010

Bind dropdownlist default value

On RowDataBound
ddlCountry.SelectedValue = Ds.Tables[0].Rows[e.Row.RowIndex]["CountryId"].ToString();

On SelectedIndexChanged
ddlRGroup.SelectedValue = Ds.Tables[0].Rows[0]["RatingId"].ToString();

if (!Page.IsPostBack)
SqlDataReader dr = SqlHelper.ExecuteReader(connectionString, "tblFormula_Select", Convert.ToInt32(ViewState["CKFId"]), "S");
ddlTemp.SelectedValue = dr["TemplateId"].ToString();

No comments:

Post a Comment