protected void ddlInformType_OnSelectedIndexChanged(object sender, EventArgs e) { double leave = 0; GridViewRow gvrow = ((DropDownList)sender).Parent.Parent as GridViewRow; DropDownList ddlInformType = (DropDownList)gvrow.FindControl("ddlInformType"); if (ddlInformType.SelectedValue == "Prior") { leave = Convert.ToDouble(gvrow.Cells[3].Text) - 1; return; } if (ddlInformType.SelectedValue == "Late informed") { leave = Convert.ToDouble(ViewState["Leave"].ToString()) - 0.5; return; } if (ddlInformType.SelectedValue == "Not Informed") { leave = Convert.ToDouble(gvrow.Cells[4].Text) + 1; return; } }
foreach(GridViewRow row in allRmaGv.Rows) { // Try to find the `dcDdl` in data rows only, because they do not exist in header or footer rows if (row.RowType == DataControlRowType.DataRow) { DropDownList dcDropDown = (DropDownList)row.FindControl("dcDdl"); dcDropDown.SelectedValue = value; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)