Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DropDown inside gridview

Thread Tools

DropDown inside gridview

sheraz_aries sheraz_aries is offline
Junior Member
Join Date: Feb 2008
Posts: 5
Now the dropdown displaying the current value from my db but how do i update the selected value so that it save in database.

# Protected Sub GV_ApproveNomination_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV_ApproveNomination.RowDataBound  
     If e.Row.RowType = DataControlRowType.DataRow Then  
         Dim cmbGender As DropDownList = CType(e.Row.FindControl("DdlGender"), DropDownList)  
         cmbGender.SelectedValue = GV_ApproveNomination.DataKeys(e.Row.RowIndex).Values(1).ToString()  
     End If  
 End Sub

 <asp:TemplateField HeaderText="Gender">  
         <asp:Label ID="lblGender" runat="server" Text='<%# Eval("iGender") %>'></asp:Label>  
      <asp:DropDownList ID="DdlGender" runat="server" SelectedValue='<%# Trim(Eval("iGender"))%>'>  
             <asp:ListItem Value="M" Text="Male"></asp:ListItem>  
             <asp:ListItem Value="F" Text="Female"></asp:ListItem>  
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dropdown Inside Gridview SelectedIndexChange Event Babu ASP .Net Web Controls 1 12-15-2007 08:01 PM
1 Gridview. Dropdown A is column from database, Dropdown B is column from database, Data in A and B must be from same row. ASP .Net 2 11-07-2007 12:40 PM
RowCommand: accessing ObjectDataSource from inside gridview inside a repeater? HockeyFan ASP .Net 1 07-04-2007 05:49 AM
bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid. vishnu ASP .Net 1 03-25-2006 01:24 PM
Select dropdown box bleeds into Javascript dropdown menu Mike HTML 1 12-18-2003 09:49 PM