Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Bind DropdownList

Bind DropdownList

Scheduled Pinned Locked Moved ASP.NET
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mkanchha
    wrote on last edited by
    #1

    Hi to all, I want to bind DropdownList inside the DataGrid. If you have the code or Examples Please Paste it. Mkanchha

    A S Q 4 Replies Last reply
    0
    • M Mkanchha

      Hi to all, I want to bind DropdownList inside the DataGrid. If you have the code or Examples Please Paste it. Mkanchha

      A Offline
      A Offline
      anrorathod
      wrote on last edited by
      #2

      Hi, Find the dropdown list control in the DataItemBound method of data grid method. and here you can use the dropdown list. Regards, Rohit Rathod Contact: +91 9898891036

      M 1 Reply Last reply
      0
      • M Mkanchha

        Hi to all, I want to bind DropdownList inside the DataGrid. If you have the code or Examples Please Paste it. Mkanchha

        S Offline
        S Offline
        Sherin Iranimose
        wrote on last edited by
        #3

        Hi Friend, You want to do following steps. ************************************************ 1.Add a new SqlDataSource. 2.In the page load function give SqlDataSource1.ConnectionString = "server=yourserver;Integrated Security=yes;Database=yourdatabase" SqlDataSource1.SelectCommand = "SELECT [field1], [field2] FROM [yourdatabase]" After these in the designe phase you should give connection to drop down list <asp:DropDownList ID="DropDownList1" runat="server" Width="156px" DataSourceID="SqlDataSource1" DataTextField="field1"> ************************************************************ thats all.... try....

        Sherin Iranimose

        1 Reply Last reply
        0
        • M Mkanchha

          Hi to all, I want to bind DropdownList inside the DataGrid. If you have the code or Examples Please Paste it. Mkanchha

          S Offline
          S Offline
          Sherin Iranimose
          wrote on last edited by
          #4

          You can do all these things at designe time. it is difficult to explain.But it is easy. try it yourself.

          Sherin Iranimose

          1 Reply Last reply
          0
          • A anrorathod

            Hi, Find the dropdown list control in the DataItemBound method of data grid method. and here you can use the dropdown list. Regards, Rohit Rathod Contact: +91 9898891036

            M Offline
            M Offline
            Mkanchha
            wrote on last edited by
            #5

            Thanks for your Reply, If you have example Please Paste it Mkanchha

            1 Reply Last reply
            0
            • M Mkanchha

              Hi to all, I want to bind DropdownList inside the DataGrid. If you have the code or Examples Please Paste it. Mkanchha

              Q Offline
              Q Offline
              qtuan
              wrote on last edited by
              #6

              Hi, You can bind Dropdownlist inside ItemTemplate of Datagrid.The following my code: <asp:GridView ID="GridView1" runat="server"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server"> </asp:DropDownList> </ItemTemplate> </asp:TemplateField> </Columns>

              M 1 Reply Last reply
              0
              • Q qtuan

                Hi, You can bind Dropdownlist inside ItemTemplate of Datagrid.The following my code: <asp:GridView ID="GridView1" runat="server"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server"> </asp:DropDownList> </ItemTemplate> </asp:TemplateField> </Columns>

                M Offline
                M Offline
                Mkanchha
                wrote on last edited by
                #7

                Thanks for your Replay, But Where is the Serverside code to bind the DropDownList Mkanchha

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups