Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
145
WInGrid add item to bound valuelist
posted

What event to I need to handle to allow users to add "fruit" the either a valuelist or ultra dropdown.

Since it is a KVP I always get format exception

//Create some fruit
Dictionary<int,string> fruits = new Dictionary<int,string>();
fruits
.Add(-1,"apple");
fruits
.Add(-2,"banana");

//Create and add to the ultraDropDown
UltraDropDown fruitUltraDropDown = new UltraDropDown();
fruitUltraDropDown
.DataSource = fruits.ToList();
fruitUltraDropDown
.DisplayMember = "Value";
fruitUltraDropDown
.ValueMember = "Key";
MyUltraGrid.DisplayLayout.Bands[0].Columns["MyColumn"].ValueList = fruitUltraDropDown;

What event can I handle so when a user types "grape" I can add it to the dictionary with my own key, and it gets added to the dropdownlist. Currently if I type "grape in the cell, I just get a format exception.

Regards

_Eric