I hope I can explain this. I will try to put together a small sample, but I wanted to get this out there as soon as I could.
I'm using ASP.Net Core 2.0.
I have a grid that has a foreign key to an enum value on my model. I have an EditorTemplate set up, which builds a SelectList from the enum values and binds it to a Kendo DropDownList, and it works great:
And in my grid:
Now, though, I have a requirement where once I select certain enum types, I have to exclude OTHER enum types from subsequent entries in my model. This is similar to, but not exactly, like a set of cascading drop downs, where the contents of the second depend upon the first.
So, I need to filter those enum types from the list. I've tried a couple things:
- setting the drop down's dataSource filter, like this:
I've tried this at various places: when I've added the item to the grid, and when I'm about to add the item. This doesn't seem to work at all.
- Loading the list of valid values via Ajax - the problem there is that I don't know whether I'm updating the FIRST value (so I can set it to anything) or a NEW value (where I would restrict), so I can't reliably determine what the values should be.
Nothing seems to work so far.
There's an option that changes my data model - but I would rather not do this if I can avoid it.
Any help is appreciated - thanks!