Datagrid and combobox - Help?!!
-
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!
-
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!
Simple. The second combobox has to be filled with the appropriate data when the first combobox selection is made, not before hand. RageInTheMachine9532
-
Simple. The second combobox has to be filled with the appropriate data when the first combobox selection is made, not before hand. RageInTheMachine9532
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,
-
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,
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