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. ListBox as a DataGrid Cell

ListBox as a DataGrid Cell

Scheduled Pinned Locked Moved C#
question
6 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
    karthik Tamizhmathi
    wrote on last edited by
    #1

    Hi all, I need to create a custom control DataGrid that should contain ListBox control as one of the column that allow to select a value from multiple values. This is possible in DataGridView. But is it possible in DataGrid ? Thanks in Advance

    Karthik M

    B Mircea PuiuM 2 Replies Last reply
    0
    • K karthik Tamizhmathi

      Hi all, I need to create a custom control DataGrid that should contain ListBox control as one of the column that allow to select a value from multiple values. This is possible in DataGridView. But is it possible in DataGrid ? Thanks in Advance

      Karthik M

      B Offline
      B Offline
      blue_arc
      wrote on last edited by
      #2

      YES IT IS POSSIBLE... I HAVE DONE IN PAST... I DONT HAVE THE CODE FOR THAT RIGHT NOW.. BU TU CAN GO CHECK OUT IN CsharpCORNER.COM. basically the idea is... fill ur datagrid... then add new column to it, and then add a combo to it.. finally fill ur combos according to the condition..... it is simple but lengthy task... hpoe u can find ur way.....

      K 1 Reply Last reply
      0
      • B blue_arc

        YES IT IS POSSIBLE... I HAVE DONE IN PAST... I DONT HAVE THE CODE FOR THAT RIGHT NOW.. BU TU CAN GO CHECK OUT IN CsharpCORNER.COM. basically the idea is... fill ur datagrid... then add new column to it, and then add a combo to it.. finally fill ur combos according to the condition..... it is simple but lengthy task... hpoe u can find ur way.....

        K Offline
        K Offline
        karthik Tamizhmathi
        wrote on last edited by
        #3

        Thanks for your reply. But i need to add multiselect listbox in the datagrid. Is there any way to do this ?

        Karthik M

        1 Reply Last reply
        0
        • K karthik Tamizhmathi

          Hi all, I need to create a custom control DataGrid that should contain ListBox control as one of the column that allow to select a value from multiple values. This is possible in DataGridView. But is it possible in DataGrid ? Thanks in Advance

          Karthik M

          Mircea PuiuM Offline
          Mircea PuiuM Offline
          Mircea Puiu
          wrote on last edited by
          #4

          You can, normally, create column types with cells that host controls of your choosing, whatever they might be. You have to define classes that derive from DataGridViewColumn and DataGridViewCell. Here[^] is shown an example for the case of a DateTimePicker control. Adapt the code to a ListBox. Oh, yes :-) there is some work to do for it, but I guess you enjoy it!

          SkyWalker

          K 1 Reply Last reply
          0
          • Mircea PuiuM Mircea Puiu

            You can, normally, create column types with cells that host controls of your choosing, whatever they might be. You have to define classes that derive from DataGridViewColumn and DataGridViewCell. Here[^] is shown an example for the case of a DateTimePicker control. Adapt the code to a ListBox. Oh, yes :-) there is some work to do for it, but I guess you enjoy it!

            SkyWalker

            K Offline
            K Offline
            karthik Tamizhmathi
            wrote on last edited by
            #5

            Thanks Mircea, I guess i have clearly mentioned in my query that i can include the ListBox in DataGridView. But i cant include the ListBox in DataGrid. Is it possible ? -- modified at 23:29 Tuesday 30th January, 2007

            Karthik M

            B 1 Reply Last reply
            0
            • K karthik Tamizhmathi

              Thanks Mircea, I guess i have clearly mentioned in my query that i can include the ListBox in DataGridView. But i cant include the ListBox in DataGrid. Is it possible ? -- modified at 23:29 Tuesday 30th January, 2007

              Karthik M

              B Offline
              B Offline
              blue_arc
              wrote on last edited by
              #6

              Hey Karthik the way i told u u can implement it, ok let me remind me my self ur question... u want add multiselect listbox... in datagrid... yes it is possible. and in the same fashion i told u in my previous post.... dont mid let me ask u a question.... do know the diff.. between Combobox and list box, in terms of web... and windows.... but what u want to achive with that... i think u r trying to do something very complicated in ur page.....

              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