title: GridView is above the drop down list. However, i want it the other way around. Drop down list is programatically added
body: <p><a href="https://i.stack.imgur.com/6bM6O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6bM6O.png" alt="enter image description here"></a>Dynamically creating a drop down list item is automatically adding the item to the bottom of the page. I have a GridView and dropdownlist items. want the drop down items to be displayed above the gridView </p>
  
  <pre><code>&lt;body&gt;
          &lt;form id="form1" runat="server"&gt;
          &lt;div&gt;
  
          &lt;/div&gt;
  
              &amp;nbsp;&lt;asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" Height="273px" Width="450px"&gt;
                    &lt;AlternatingRowStyle BackColor="White" ForeColor="#284775" /&gt;
                    &lt;EditRowStyle BackColor="#999999" /&gt;
                    &lt;FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /&gt;
                    &lt;HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /&gt;
                    &lt;PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /&gt;
                    &lt;RowStyle BackColor="#F7F6F3" ForeColor="#333333" /&gt;
                    &lt;SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /&gt;
                    &lt;SortedAscendingCellStyle BackColor="#E9E7E2" /&gt;
                    &lt;SortedAscendingHeaderStyle BackColor="#506C8C" /&gt;
                    &lt;SortedDescendingCellStyle BackColor="#FFFDF8" /&gt;
                    &lt;SortedDescendingHeaderStyle BackColor="#6F8DAE" /&gt;
                    &lt;/asp:GridView&gt;
       &amp;nbsp;&amp;nbsp;&lt;br /&gt;
              &amp;nbsp;
              &lt;div&gt;
                  &lt;asp:Button ID="InputPageSubmitButton" runat="server" Text="Submit" Width="149px" /&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  </code></pre>
  
  <p>HTML CODE ABOVE:</p>
  
  <p>VB.net Code Below </p>
  
  <pre><code>Imports System.IO
  
  Public Class WebForm1
      Inherits System.Web.UI.Page
  
  
      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
          'Load Excel File on Page Load 
  
          loadExcel()
          If Not IsPostBack Then
              For i As Integer = 0 To GridView1.Rows(0).Cells.Count
                  Dim dd1 As New DropDownList()
                  dd1.ID = "dd1" + i.ToString()
  
  
                  dd1.Items.Add("Borough")
  
                  form1.Controls.Add(dd1)
  
              Next
          End If
          MsgBox(GridView1.Rows(0).Cells.Count)
  
  
      End Sub
  
      Public Function loadExcel() 'loadExcel Function to show the file to the gridView.
  
  
          Dim MyConnection As System.Data.OleDb.OleDbConnection
          Dim DtSet As System.Data.DataSet
          Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
          Dim filePath = Path.Combine(GlobalVariable.savedPath, GlobalVariable.excelFileName)
  
          'Code to Use an Oledb Connection to get data from the Excel File
          MyConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" &amp; filePath &amp; ";Extended Properties='Excel 12.0 Xml;HDR=YES;';")
          'Code to Read the Sheet Selected from the Excel Spread Sheet'
          MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection)
          '-- Extra Code Not Needed which Maps the tables as Columns from the Spreadsheet
          'MyCommand.TableMappings.Add("Table", "Net-informations.com")
          DtSet = New System.Data.DataSet
          MyCommand.Fill(DtSet)
          'Populates GridView with the excel Spreadsheet
          GridView1.DataSource = DtSet.Tables(0)
          'Code Below needed to show the excel to GridView
          GridView1.DataBind()
          MyConnection.Close()
  
          Return Nothing
      End Function
      Protected Sub InputPageSubmitButton_Click(sender As Object, e As EventArgs) Handles InputPageSubmitButton.Click
          Response.Redirect("OutputSelectPage.aspx", True)
      End Sub
  End Class
  </code></pre>