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
165
Deleting the selected item of a comboboxfield
posted

Good Morning

So I have the following XamDataGrid

As you can see, when I selected title 1 in the first row, it was removed from the list in the second row. However, if I change the selection in the first row to title 3 for example, title 1 won't reappear in the second row, instead both titles 1 and 3 will be removed. How can I solve this problem, I only want the currently selected value to be removed.

Here is my backend code:

private void XamDataGrid_DataValueChanged(object sender, DataValueChangedEventArgs e)
{

SampleData sd = e.Record.DataItem as SampleData;

ViewModel vm = new ViewModel();

if (e.Field.Name == "Combo1")
{
string s = sd.Combo1;
if (s != null)
vm.AccountTitle_Combo.Remove(s);
}

}

Parents Reply Children
No Data