Maintain GridView Inside DropDown Selected Value in Asp.Net


        protected void gdvViewInterview_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Label lblInterviewStatus = (Label)e.Row.FindControl("lblCandStatus");
           

                if (lblInterviewStatus != null)
                {
                    ViewState["CandidateStatus"] = lblInterviewStatus.Text;
                }
                DropDownList ddlInterviewStatus = (DropDownList)e.Row.FindControl("ddlCandStatus");
                if (ddlInterviewStatus != null)
                {
                    ddlInterviewStatus.SelectedValue = Convert.ToString(ViewState["CandidateStatus"]);
                }

               
            }
        }

0 comments:

Post a Comment