Difficulty invoking custom method

I am carefully following the instructions on https://www.radzen.com/documentation/blazor/invoke-method/ just trying to implement the Sum() method, but no matter what: the custom method is not listed... On the other hand several other methods are listed which seems strange:

  • Grid0RowSelect
  • OnPropertyChanged
  • Reload
  • ToString

Thanks!

Is the Sum() method defined in the page partial class?

Hi semafox, if your custom method is not listed, try to call it as a C# code. That option is always listed. Infact it has become my favourite way of implementing of calling custom methods refer to the following tutorial where I call a custom method in login.razor.cs from login.razor.designer.cs as executable C# code. Regards.

Hi Vladimir, Ben,

Thanks for your quick reply. I found the work around: I need to exit Radzen and restart it after having made the change, and then it shows. My guess is that the refresh button next to the drop down that lets the user select the custom method is not working. I made a small demo video of the issue if this can help.

Radzen was already an impressive product a year or so ago when I tried it, but it has matured significantly since and the Blazor version is quite amazing, what a great job you guys are doing, thanks!

1 Like

@semafox, we will investigate this issue and see if we can improve the behavior.

@semafox, unfortunately we were unable to reproduce the problem from the video. Could you zip your application and send it over to info@radzen.com? Delete the obj, bin and wwwroot directories within the application to keep the file size smaller.

@semafox we got your project and tried to reproduce the issue but failed to do so. Here is a screen recording of what I tested. Am I doing something different?

I have noticed the same thing, i have to exit the page i'm working on with a custom method then go back to it and its there.

Same problem here.newly implented c# methods in partial class will not be listed in Radzen. The refresh button to the right has no effect. Closing Radzen and starting it again. Going to the same invode method... the new method is there. seems to be a refreshing problem.

@korchev I looked at your screen recording. it seems that you are doing the same. Only difference is that i am using visual studio instead of visual code.. :thinking:

Video

Actually I wasn't using VS Code but another text editor (vim). The text editor shouldn't make any difference since Radzen listens for file changes. Anyway we will continue our tests. Hopefully we will reproduce this issue somehow.

This could actually be the problem. Does it work if you save the file with any other text editor (even Notepad)? We will see why Radzen doesn't immediately detect changes made in Visual Studio.

@semafox, @Thomas, @johnmu, @Benjamin_Fadina

It turned out Visual Studio Professional is saving the files in a way which remains undetected by Radzen. For example it creates a child directory with the same name, updates the file there and then updates the original file (??). Anyway the latest Radzen release (2.51.7) should address this issue.

Version 2.51.7 installed. Tested it and works fine

Great work!

Many Thanks!
Thomas

Hi! I experienced the exact problem (the Reload button not working on the Sum example). I upgraded to version 2.69.4 and I still have to shutdown Radzen and open it up again before my new methods are visible (i.e the Reload button still does nothing).

fyi my code editor of choice is Visual Studio 2019 Professional

Regards,

Len