I'm trying to quickly modify the default enum editor so that it only displays certain values (the enum has about 10 values, but on each row of my OLV only 2-3 values need to be available, depending on the other data)
I'm just trying to get something functional and I'll probably come back to this to make it nicer in the future, for now I just want it to work
I've used a delegate to set up a new combobox which I've populated the way I need, but I can't get a value back from it - I've used an aspectputter to try and solve this, and the newvalue I'm getting back is null every time. I'm guessing this is because there's no Value property on the combobox, and the Text property doesn't return the selected item in dropdownlist mode either.
Is there a quick and easy way around this or am I going to have to create a custom control to make this work?
code looks a bit like this
ObjectListView.EditorRegistry.Register(typeof(MatchType), delegate(Objectobj, OLVColumncol, Objectvalue)
{
ComboBoxbox=newComboBox();box.DropDownStyle=ComboBoxStyle.DropDownList;//populatecomboboxDatam=(Data)obj;if(m.condition1)box.Items.Add("Option1");if(m.condition2)box.Items.Add("Option2");//etcreturnbox;
});column.AspectPutter=delegate(objectmodel, objectnewValue) {
Datam=(Data)model;strings=(string)newValue; // this is null every timem.Thing=s;
};
Last edit: James King 2020-06-20
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to quickly modify the default enum editor so that it only displays certain values (the enum has about 10 values, but on each row of my OLV only 2-3 values need to be available, depending on the other data)
I'm just trying to get something functional and I'll probably come back to this to make it nicer in the future, for now I just want it to work
I've used a delegate to set up a new combobox which I've populated the way I need, but I can't get a value back from it - I've used an aspectputter to try and solve this, and the newvalue I'm getting back is null every time. I'm guessing this is because there's no Value property on the combobox, and the Text property doesn't return the selected item in dropdownlist mode either.
Is there a quick and easy way around this or am I going to have to create a custom control to make this work?
code looks a bit like this
Last edit: James King 2020-06-20