This question is locked. New answers and comments are not allowed.
I have an editable grid with a foreign key column. Each one of my rows has a distinct value of the foreign key. Row1 and row2 can't have the same foreign key. That's why what I want is this: when I delete row1, the foreignKeyOfRow1 to be removed from the combobox for the foreign key column. I'm trying to do that by this:
var dropdown = $("#MyForeignKeyColumn").data('tDropDownList');
var dataSource = ['1', '2', '3'];//some examples
dropdown.dataBind(dataSource);
But I can't select something from the combobox after that - the combobox doesn't notice the selected item. I get error "The MyForeignKeyColumn field is required. " because the comboBox is empty.
In the controller, in the method for deleting the item in the row, I'm returning Json with the new values I want the grid to be populated with (with no foreignKeyOfRow1 and no row1, and row1 is gone, but foreignKeyOfRow1 remains).
var dropdown = $("#MyForeignKeyColumn").data('tDropDownList');
var dataSource = ['1', '2', '3'];//some examples
dropdown.dataBind(dataSource);
But I can't select something from the combobox after that - the combobox doesn't notice the selected item. I get error "The MyForeignKeyColumn field is required. " because the comboBox is empty.
In the controller, in the method for deleting the item in the row, I'm returning Json with the new values I want the grid to be populated with (with no foreignKeyOfRow1 and no row1, and row1 is gone, but foreignKeyOfRow1 remains).