narasiman rao

narasiman rao

  • NA
  • 519
  • 765.8k

display gridview selected row value to dropdownlist in c#

Aug 12 2015 1:16 AM
 
    i want to display gridview selected row value to dropdownlist.

for that my code as follows
protected void gvFacdet_SelectedIndexChanged(object sender, EventArgs e)
{
txt_name.Text = gvFacdet.SelectedRow.Cells[1].Text.ToString();
ddldesg.Items.Add(gvFacdet.SelectedRow.Cells[2].Text.ToString());

}

In gridview row as follows
                   Name       Designation
       select Ramesh       Courseofficer

in run mode as follows

Name                textbox
Designation     dropdownlist

When i select the gridview row value that gridview selected row value to be displayed in respective textbox and dropdownlist

In textbox name to be displayed and dropdownlist designation to be displayed.

please help me what is the problem in my above code.

Answers (4)