0

dropdown in gridview

<asp:TemplateField HeaderText="ProjectModifiedBy" HeaderStyle-BackColor="#C0C0C0" HeaderStyle-BorderColor="Black">
        <ItemTemplate>
              <asp:DropDownList ID="DropDownList1" Width="99%" runat="server">
            </asp:DropDownList>
         </ItemTemplate>                 
    </asp:TemplateField>

code of web method

     <WebMethod()> _
Public Function BindDropDown() As SqlDataReader
    Dim strConnString As String = ConfigurationManager.ConnectionStrings("conString").ConnectionString
    Dim sqlQuery As String

    sqlQuery = "Sp_SelectEmpName"
    Dim con As New SqlConnection(strConnString)
    Dim cmd As New SqlCommand(sqlQuery, con)
    cmd.CommandType = CommandType.StoredProcedure
    Dim reader As SqlDataReader
    con.Open()
    reader = cmd.ExecuteReader()

    Return reader
End Function

this is the code behind method which calls webmethod,what should i write here to bind the empname column data with dropdown of gridview

  Private Sub BindDataDropDown()

  End Sub
sona
  • 1,552
  • 3
  • 18
  • 37

0 Answers0