//DropDown
DropDownList D_grade = (DropDownList)Grid_studenthealth.Rows[i].FindControl("drpGrade");
public void Grid_studenthealth_OnRowDataBound(object sender, GridViewRowEventArgs e)
{
dt = Bind_Disiplan_Grade();
if (e.Row.RowType == DataControlRowType.DataRow)
{
DropDownList DDL_Grade = (DropDownList)e.Row.FindControl("drpGrade");
Label di_Grade = (Label)e.Row.FindControl("grid_Grade");
DDL_Grade.DataSource = dt;
DDL_Grade.DataTextField = "grade";//grade Column Name
DDL_Grade.DataValueField = "grade";
DDL_Grade.DataBind();
DDL_Grade.Items.Insert(0, new ListItem("--Select Grade--", "0"));//Add New Item
DDL_Grade.SelectedValue = di_Grade.Text.Trim();
}
DropDownList D_grade = (DropDownList)Grid_studenthealth.Rows[i].FindControl("drpGrade");
public void Grid_studenthealth_OnRowDataBound(object sender, GridViewRowEventArgs e)
{
dt = Bind_Disiplan_Grade();
if (e.Row.RowType == DataControlRowType.DataRow)
{
DropDownList DDL_Grade = (DropDownList)e.Row.FindControl("drpGrade");
Label di_Grade = (Label)e.Row.FindControl("grid_Grade");
DDL_Grade.DataSource = dt;
DDL_Grade.DataTextField = "grade";//grade Column Name
DDL_Grade.DataValueField = "grade";
DDL_Grade.DataBind();
DDL_Grade.Items.Insert(0, new ListItem("--Select Grade--", "0"));//Add New Item
DDL_Grade.SelectedValue = di_Grade.Text.Trim();
}
No comments:
Post a Comment