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. General Programming
  3. Visual Basic
  4. Datagrid and combobox - Help?!!

Datagrid and combobox - Help?!!

Scheduled Pinned Locked Moved Visual Basic
helpquestioncsharpcss
4 Posts 2 Posters 1 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.
  • R Offline
    R Offline
    r47693
    wrote on last edited by
    #1

    Hi .Net'ers, I have a datagrid with two columns being represented as comboboxes. The problem is that the list of valid values in the second combobox depends on what value is selected in the first combobox. Ex: LEt us assume there is a datagrid with two columns - Animal and Property Animal contains the following values: CAT, DOG. Property contains: meows, barks, fur, nofur, indoor, outdoor When I load the datagrid the Animal and property columns are appropriately filled with above. Now if the user selects 'CAT', the second combobox in the grid should only display {meows, fur, indoor} and for DOG it should only display {barks, nofur, outdoor}. How can I acocmplish this? Thanks in advance for your help!

    D 1 Reply Last reply
    0
    • R r47693

      Hi .Net'ers, I have a datagrid with two columns being represented as comboboxes. The problem is that the list of valid values in the second combobox depends on what value is selected in the first combobox. Ex: LEt us assume there is a datagrid with two columns - Animal and Property Animal contains the following values: CAT, DOG. Property contains: meows, barks, fur, nofur, indoor, outdoor When I load the datagrid the Animal and property columns are appropriately filled with above. Now if the user selects 'CAT', the second combobox in the grid should only display {meows, fur, indoor} and for DOG it should only display {barks, nofur, outdoor}. How can I acocmplish this? Thanks in advance for your help!

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Simple. The second combobox has to be filled with the appropriate data when the first combobox selection is made, not before hand. RageInTheMachine9532

      R 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Simple. The second combobox has to be filled with the appropriate data when the first combobox selection is made, not before hand. RageInTheMachine9532

        R Offline
        R Offline
        r47693
        wrote on last edited by
        #3

        Sorry! that may not be possible, because ther are already rows that have been populated. Let me take the actual example:- Wear your manufacturing hat.. The columns in the datagrid are WOrkorder, Itemtobemade (COmbobox), qty, Operation (COmbobox), startdate On Form_Load all the currently scheduled workorders are displayed. So I bind the "Select" statement to the dataset and then to the datagrid. My issue is that based on the item selected only the allowed operations to make that item must be allowed. So when the user adds a new workorder and selects an item, the appropriate operations alone must be shown in the operations combobox. Can somebody suggest the code to control the combobox values at a cell level? TIA,

        D 1 Reply Last reply
        0
        • R r47693

          Sorry! that may not be possible, because ther are already rows that have been populated. Let me take the actual example:- Wear your manufacturing hat.. The columns in the datagrid are WOrkorder, Itemtobemade (COmbobox), qty, Operation (COmbobox), startdate On Form_Load all the currently scheduled workorders are displayed. So I bind the "Select" statement to the dataset and then to the datagrid. My issue is that based on the item selected only the allowed operations to make that item must be allowed. So when the user adds a new workorder and selects an item, the appropriate operations alone must be shown in the operations combobox. Can somebody suggest the code to control the combobox values at a cell level? TIA,

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Well, you'r going to have to make it work that way because you can't tell a combobox which items in its list to display and which to not display. It's all or nothing... RageInTheMachine9532

          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