Working on some UI elements, I noticed that combo box cell is a bit unwieldy and has unexpected behavior. Most pressing is that changes are not committed as expected under certain circumstances.
internal class EtoBug: Dialog
{
string[] dropdatastore = new string[] { "Test 1", "Test 2" };
public EtoBug()
{
Size = new Size(300, 300);
var example = new GridView();
example.Columns.Add(new GridColumn
{
DataCell = new ComboBoxCell(0) { DataStore = dropdatastore},
HeaderText = "Test",
Expand = true,
Editable = true
});
example.DataStore = new[] { new GridItem("Test 1") };
Content = example;
}
}
If I click on the option “Test 2”, the drop list loses focus and the change is not committed. After some further testing, I found that the change is committed when:
- The drop list expands over other grid items in the grid view,
- The drop list expands outside of the bounds of the grid view.
In terms of using combo box cells, it’s fairly inconvenient to change their values. I have a form that might have 20 or so of these drop boxes and each one will require at minimum three clicks to edit. I assume that the three clicks set the focus to the grid view, then to the cell, then the last one opens the drop list. I would expect the drop list to open on two clicks max but ideally in only one click, to mimic the behavior of other drop lists.
If this intended or if there is a work-around, please let me know. Thanks,
~CH
