jhonnybook
New Member
i have a gridview on the form and have some template field, one of them is:\[code\]<asp:TemplateField HeaderText="Country" HeaderStyle-HorizontalAlign="Left"> <EditItemTemplate> <aspropDownList ID="DdlCountry" runat="server" DataTextField="Country" DataValueField="Sno"> </aspropDownList> </EditItemTemplate> </asp:TemplateField>\[/code\]now on the RowEditing event i need to get the selected value of dropdownlist of country and then i will set that value as Ddlcountry.selectedvalue=http://stackoverflow.com/questions/14584175/value; so that when dropdownlist of edit item template appears it will show the selected value not the 0 index of dropdownlist. but i am unable to get the value of dropdown list.i have tried this already:\[code\]int index = e.NewEditIndex;DropDownList DdlCountry = GridView1.Rows[index].FindControl("DdlCountry") as DropDownList;\[/code\]need help please.thanx.