Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles GridView1.RowEditing Dim row As GridViewRow Dim lstdrop As DropDownList row = GridView1.Rows.Item(e.NewEditIndex()) lstdrop = row.FindControl("DropDownListOwner") lstdrop.SelectedIndex = 3 End Sub
<EditItemTemplate> <asp:DropDownList ID="DropDownListOwner" runat="server" DataSourceID="SqlDataOwner" DataValueField="User_name" DataTextField="User_name" AutoPostBack="true"> </asp:DropDownList> </EditItemTemplate>
NewEditIndex
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)