I have a grid and one of those columns is set to be a dropdown. When I create the dropdown I provide a DataTable that is associated with the drop down. But, what I'd really like to do is have a 'grid' be associated with the drop down and not just a DataTable. I'd like for the drop-down to contain a grid that also has dropdowns.
In my program each row in the main grid represents a Table stored on our database. When the user selects the drop-down in the 'Fields' column; I want to display a grid showing each of the fields that exist in that table in one column and in the next, provide a 'Yes/No' drop down to allow the user to select which fields from that table to include in his or her search.
Could someone point me in the right direction with this?
2nd Link was perfect.
Thanks!
I'm not really sure I understand exactly what you want. If you just want a dropdown that looks like a grid, then you should read this KB article: HOWTO:What is the best way to place a DropDown list in a grid cell?
If you want somthing more complicated, like a dopdown that can be edited by the user, or maybe a multi-select dropdown, then you would have to make your own. This is a lot easier than it may seem. What you do is use an UltraTextEditor. Add a DropDownEditorButton to the ButtonsRight collection. You can set the Control property on this button to put any control you want on the dropdown. Then you can attach the UltraTextEditor to the grid column via the EditorControl property and handle a couple of events to deal with what happens when the user selects a row.
HOWTO:Creating a Multi-Select Dropdown Combo for the WinGrid
Just as a quick follow up - if a nested grid is going to be a problem, I'd be equally happy if I could get an UltraTree to 'drop down' - or just a list of checkboxes.
I've tried sticking a grid or a tree as the Column's .EditorControl but that won't work. There are a handful of editors I can stick into the grid though, UltraComboEditor seems to be 'close' to what I want; but it's virtually the same as a regular drop down from what I can gather.