Issue with On Change event on Numeric component in DataGrid

Hi

If I put a Numeric component on a Page and set the on change event to set a page property it works fine. But if I put a Numeric component in the DataGrid column template when I set the on change event to set a page property I get this error:

error CS1503: Argument 2: cannot convert from 'Microsoft.AspNetCore.Components.EventCallback' to 'Microsoft.AspNetCore.Components.EventCallback'
error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type

Am I doing something wrong? Or can't you use the change event from within a DataGrid template (Or possibly any template)

Cheers.

Hi,
It is possible to set Page property from datagrid. Can you share your code snippet ?

Is the Value property of the Numeric set? If not it won't have its generic argument initialized. Check this thread for more info: Numeric change event double? values - #2 by korchev

Try removing the Numeric, adding it again, setting its Value property and then handle the Change event.

1 Like

Thank you so much guys. It was really weird after I removed the Value property and then reset it again it then worked fine. It seems to be if you set the Value first then set the On Change event it will cause the above error. But if you do it the other way around (Change Event first then Value) or just clear out and then reset the Value it will be fine.

Keep up the amazing work.