Hi,
We're using an UltraGrid with a ValueList-based column (with a list of operators).I would like to achieve a combination of the DropDownList style and the Button style (screenshot).
If the user clicks on the button, it should toggle the dropdown. Unfortunately, I didn't find a way to achieve this behavior. I've tried to toggle the dropdown in the ClickCellButton, but this has no effect.
Any ideas?
Thanks in advance,
Kevin
Hi Kevin,
I'm a bit confused by your explanation. What exactly are you trying to do?
It sounds like maybe you need to use a DropDownEditorButton in an editor that drops down a control rather than a ValueList, but it's really not clear to me what distinction you are making here regarding the behavior you want and what the ValueList already does.
Hi Mike,
Sorry for the confusion. I'll try to explain it a little better. What I want is a regular DropDownList with the values from my ValueList. But the cell should be drawn as a Button with the selected value from the DropDownList instead of a normal DropDownEditor with the selected value. Clicking on the button should show the DropDownList, just like you click on the DropDownButton next to a DropDownEditor.
What I want is not 1, but 2 in the below picture.
Kind Regards,
Hm, that's a little tricky. There's no built-in way to do something like that, but it should be possible to code it using a combination of the NetAdvantage controls.
What I would do is start by creating your own control which does this as a standalone control, independent of the grid.
So I would start with a UserControl and put an UltraDropDownButton and an UltraListView control on it. You would have to expose a Value property on your user control and handle some events so that when the user clicks on the ListView, you change the selected value. And you would also probably want to select the current value on the list when the user drops down the button.
Then you could use the UltraControlContainerEditor component to embed this control in the grid cell.
A slightly simpler implementation would be to use an UltraComboEditor with a DropDownEditorButton in it's ButtonsRight collection and then simply size the width of the cell so that only the button is displayed. But this might be tricky, since the length of the text you have here varies and the button width will depend on the text.
I did not have the time to try your suggestions. Also because the wanted behavior is rather a "Could have" priority than a "Must have". But if there is some time left, I may give your second solution a try.
Anyhow,
Thanks for your help (again).
Greetings