Skip to content Skip to sidebar Skip to footer

Display Value Of A Gridview Selected Row To Dropdownlist

So I have a problem in displaying the selected row value to dropdownlist. Can someone help me please here is a sample scenario: As you can see, the selected row value of Departmen

Solution 1:

In GridView1_RowCommand, Instead of

   DropDownList1.Items.Add(gr.Cells[3].Text.ToString());
   DropDownList2.Items.Add(gr.Cells[4].Text.ToString());

Add

DropDownList1.SelectedValue=gr.Cells[3].Text.ToString();DropDownList2.SelectedValue=gr.Cells[4].Text.ToString();

Post a Comment for "Display Value Of A Gridview Selected Row To Dropdownlist"