Set DropDownList Selected Value on GridView Edit Button Click using C# and VB.Net in ASP.Net

Last Reply 5 months ago By dharmendr

Posted 5 months ago

When i select row from gridview for editing, then in dropdownlist value(Sections) get change in popup window,

here is screen link , so i want that value which exit in row must display same in popup window dropdownlist.

here is c# code.

        protected void Edit(object sender, EventArgs e)
            using (GridViewRow row = (GridViewRow)((LinkButton)sender).Parent.Parent)
                txtEmpID.ReadOnly = true;
                txtEmpID.Text = row.Cells[0].Text;
                txtEmpName.Text = row.Cells[1].Text;
                txtFahterName.Text = row.Cells[2].Text;
               ddlSecID.SelectedItem.Value = row.Cells[3].Text;



This question does not have replies that have been liked.