Reading value from database

Good Afternoon!

Currently I'm trying to read a value from the database and insert that value into a Radzen component. To read this value, I've made a custom method:

The printed value is the one that is in the database, so that is working fine. However, I don't see how I can show this value within my Radzen application. I'm currently using a mask component but perhaps this isn't the right component.

I'm trying to insert the value into the red box. Maybe I am using the wrong component though.

If possible, I also would like to update this value in realtime. How can I do that?

Hope you can help me!

Hi @ChrisI,

You need to store the result of the method in a page property. Then set the Value of the TextBox to that property.

More details:

Display property value

Invoke custom method and set a property (step 6)

Basically you need to handle the Then event of the Invoke method action and add a new action of type Set Property where Value is set to ${result} and Name is set to something like tag. Then set the TextBox Value property to ${tag} (from the Property grid).

1 Like

@korchev Thanks! This is working. However, I want to update this value in realtime. My application is currently waiting for an action while I actually want to see the data when I load the page (so I won't have to click a button). It would be best to have this value updated realtime. Does Radzen have a built-in timer? Or do I need to program that myself?

Radzen does not have a built-in timer because .NET already includes one. You can check this thread for tips how to use the .NET Timer in Blazor.

1 Like