I need to be able to run a function after a selection in made in a . The issue is I\'m also binding with @bind and I get a error when I try to use @o
This seems to be a popular confusion. Firstly you cant use @onchange
since it would internally be used by @bind
. You should be able to access the selected value from the setter of your CustChanged
property. Based on what you are trying to do with your CustChanged
, you may not even need to manually check when this value is updated. For instance, if your intent is to use CustChanged
in your UI directly or indirectly (within Linq or something), the UI would automatically update with CustChanged
value when your is changed. Hence, for most use cases I don't see the need to check when it was updated.
To use @onchange
, you can bind it to a function something like this:
public void OnUpdated(ChangeEventArgs e)
{
var selected = e.Value;
}