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

Last Reply one month ago By dharmendr

Posted one month ago

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

here is screen link https://ibb.co/4Fj6kHt , 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;

                popup.Show();
            }
        }

 

This question does not have replies that have been liked.