A simple textbox data-binding to a field's value of invoked table

Hi. I've checked the out of box CRUD grids, master-detail configurations, applied security and that all works well.

I'm very new to C# and even newer to Radzen, and what I'm trying to achieve will probably take less than a minute to 99% of the people in this forum. Probably less time than reading this convoluted post.

With data connection established, in the Load event of an empty page, I'm reading a table of countries by the standard "Invoke data source method". Filtering only one record, let's say "getCountries" filter country="Spain". Then I set the Property getCountriesResult to {result} , Property type IEnumerable<Test1.Models.ConDbtest.Countries> .

The question is how do I bind a textbox1 (or Label1, for that matter) to a field value of that {result} recordset. Like assign {getCountriesResult.continent} to textbox1 's Text, so it can display "Europe" in that textbox? I know {getCountriesResult.continent} is not the right syntax. I haven't figured out if (and how) I should use FirstOrDefault(), what is the syntax of that in this case. The closest I've gotten is ${getCountriesResult.GetEnumerator().Current.continent} but that doesn't display anything and throws the "Unhandled exception rendering component: Object reference not set to an instance of an object." exception.
Also, I know I need to see what's the difference between {result} and {result.value}, if that's my issue.

It seems a very simple basic task, yet I don't know how to achieve it. No grid no nothing, just read a record of a table and display it in a textbox. Right from the Radzen IDE, without going into any of the cs programs. Nothing customized.

In a broader short term plan, I want to display a grid of the Detail table, with some basic info/values from the Master table shown above that grid.
Again, the Master-Detail two grids on a same page out-of-the-box approach works, foreign key used and all that.

If it makes any difference, I'm using MySQL data, and this is for a Radzen Blazor server side.

Thanks in advance!
Sime
PS in other words, what comes after the attached snapshot, so I can use it to give the particular values to Page's textbox. How do I cast the different parts of the {result} object.

if the method returns collection getXXXResult will be IEnumerable<T> and you can use FirstOrDefault() to get the first item. There is also ElementAtOrDefault() that can be used to get item by index. Once you have reference to desired item you can access item properties like this: item.SomeProperty.

1 Like

Thanks Vladimir!
It was the ${getCountriesResult}.FirstOrDefault().continent syntax I was looking for.
Cheers.