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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. UI Controls in Windows DataGrid

UI Controls in Windows DataGrid

Scheduled Pinned Locked Moved C#
questiondesignhelp
5 Posts 3 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.
  • K Offline
    K Offline
    Kais4U
    wrote on last edited by
    #1

    Hi All, I want to create a datagrid with 4 columns. The third column should have a combo box and the last column should have a checkbox. Its easy to get the checkbox column but how can I create a combo box column. The combo box should be visible always not only when it is selected. Can any one tell me, how do I place combo box for each cell in third column of a windows datagrid contorl? Any help is appriciated. Thanks in advance.:) Regards Kais

    G R 2 Replies Last reply
    0
    • K Kais4U

      Hi All, I want to create a datagrid with 4 columns. The third column should have a combo box and the last column should have a checkbox. Its easy to get the checkbox column but how can I create a combo box column. The combo box should be visible always not only when it is selected. Can any one tell me, how do I place combo box for each cell in third column of a windows datagrid contorl? Any help is appriciated. Thanks in advance.:) Regards Kais

      G Offline
      G Offline
      gnjunge
      wrote on last edited by
      #2

      This is answer is without having VS in front of me and I didn't program ASP.net for some months so my memory of the terminology is a bit rusty. Turn your datagrid column into <asp:templatecolumn>, then add an <itemtemplate></itemtemplate> within the itemtemplate you can add your <ASP:DropDownList>, make sure to add the right events to the dropdownlist. If you want to fill the dropdownlist on runtime, you have to hook up to the itemdatabind (or something like that) event, there every row of the datagrid is being filled. -- modified at 8:44 Wednesday 21st June, 2006

      K 1 Reply Last reply
      0
      • G gnjunge

        This is answer is without having VS in front of me and I didn't program ASP.net for some months so my memory of the terminology is a bit rusty. Turn your datagrid column into <asp:templatecolumn>, then add an <itemtemplate></itemtemplate> within the itemtemplate you can add your <ASP:DropDownList>, make sure to add the right events to the dropdownlist. If you want to fill the dropdownlist on runtime, you have to hook up to the itemdatabind (or something like that) event, there every row of the datagrid is being filled. -- modified at 8:44 Wednesday 21st June, 2006

        K Offline
        K Offline
        Kais4U
        wrote on last edited by
        #3

        Thanks for that suggestion. It works for ASP.NET. Am developing a windows application and using DataGrid available for winforms. Is there a why how to do it in winform datagrid control?? Regards Kais

        G 1 Reply Last reply
        0
        • K Kais4U

          Thanks for that suggestion. It works for ASP.NET. Am developing a windows application and using DataGrid available for winforms. Is there a why how to do it in winform datagrid control?? Regards Kais

          G Offline
          G Offline
          gnjunge
          wrote on last edited by
          #4

          I overlooked the "windows" part in the title. There is a way, but since I don't have VS in front of me, its kind of hard for me to help you. I believe there is already a .NET object made by somebody that does this. I would use reflector and check how the other columns (checkbox, textbox etc) are made, and then in the same way create a dropdownlist column.

          1 Reply Last reply
          0
          • K Kais4U

            Hi All, I want to create a datagrid with 4 columns. The third column should have a combo box and the last column should have a checkbox. Its easy to get the checkbox column but how can I create a combo box column. The combo box should be visible always not only when it is selected. Can any one tell me, how do I place combo box for each cell in third column of a windows datagrid contorl? Any help is appriciated. Thanks in advance.:) Regards Kais

            R Offline
            R Offline
            Robert Rohde
            wrote on last edited by
            #5

            Searching for DataGrid ComboBox[^] gives several results. I think one of those should match your needs.

            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