Datagrid not refreshing on button subsequent button clicks

I’m trying a simple test to learn how to use Radzen and am getting stuck on populating a datagrid.

I have a text box, button, and datagrid. On the button click I call my datasource and pass the text box value in as a parameter to the data source. I then set a property on the returned result. This property is bound to the datagrid.

When I run the page and enter a value in the text box and click the button the grid populates with the expected results.

However each subsequent change to the value in the text box and the click of the button is not reflected in the datagrid and the datagrid continues to always show the first search result. Even if I click to another page and then back and do a new search, the grid still repopulates with the results from my first search, I have to close it down and reopen it to do a new search but then again that new search results are all that ever displays, I can’t get it to refresh and update with the new searches results.

Any ideas from what I’m describing that I would need to do to force the datagrid to update with the new search results?

Thanks,
Nick

Hi Nick,

Did you follow this help article? If yes it should still work as advertised.

Can you paste here the JSON of the page you are creating? You can find it in the meta\pages directory of your Radzen application.

The difference between that sample help article and what I’m doing is that it calls a method with no parameters so it applies a filter param to the results.

My datasource is on a stored procedure that takes in 2 params that I’m assigning from the text box values.

Again, it works for my first search but I can’t get the datagrid data to refresh and change with subsequent searches.

Here’s the JSON page contents:

{
“access”: [
“Everybody”
],
“components”: [
{
“components”: [
{
“class”: “col-xl-2 text-xl-right”,
“components”: [
{
“name”: “label0”,
“text”: “Customer Name:”,
“type”: “label”
}
],
“name”: “col1”,
“type”: “col”
},
{
“class”: “col-md-12 col-xl-3”,
“components”: [
{
“events”: {
“change”: []
},
“name”: “textbox0”,
“type”: “textbox”,
“value”: “”
}
],
“name”: “col2”,
“type”: “col”
},
{
“class”: “col-md-12 col-xl-2 text-xl-right”,
“components”: [
{
“name”: “label1”,
“text”: “# of rows:”,
“type”: “label”
}
],
“name”: “col3”,
“type”: “col”
},
{
“class”: “col-md-12 col-xl-3”,
“components”: [
{
“name”: “numeric0”,
“type”: “numeric”
}
],
“name”: “col0”,
“type”: “col”
},
{
“class”: “col-md-12 col-xl-2”,
“components”: [
{
“events”: {
“click”: [
{
“condition”: “”,
“error”: [
{
“detail”: “”,
“severity”: “error”,
“summary”: “Error running search”,
“type”: “notify”
}
],
“name”: “SQLTest.getSearchForCustomersNbs”,
“parameters”: [
{
“name”: “SearchText”,
“value”: “${this.textbox0.value}”
},
{
“name”: “MaximumRowsToReturn”,
“value”: “10”
}
],
“then”: [
{
“condition”: “”,
“name”: “customers”,
“type”: “set”,
“value”: “${result.value}”
}
],
“type”: “invoke”
}
]
},
“icon”: “”,
“name”: “button0”,
“text”: “Search”,
“type”: “button”
}
],
“name”: “col5”,
“type”: “col”
}
],
“name”: “row0”,
“type”: “row”
},
{
“components”: [
{
“class”: “col-md-12 col-xl-12”,
“components”: [
{
“columns”: [
{
“format”: “”,
“property”: “CityName”,
“title”: “City Name”,
“type”: “string”
},
{
“format”: “”,
“property”: “CustomerID”,
“title”: “Customer ID”,
“type”: “integer”
},
{
“format”: “”,
“property”: “CustomerName”,
“title”: “Customer Name”,
“type”: “string”
},
{
“format”: “”,
“property”: “FaxNumber”,
“title”: “Fax Number”,
“type”: “string”
},
{
“format”: “”,
“property”: “PhoneNumber”,
“title”: “Phone Number”,
“type”: “string”
},
{
“format”: “”,
“property”: “PrimaryContactFullName”,
“title”: “Primary Contact Full Name”,
“type”: “string”
},
{
“format”: “”,
“property”: “PrimaryContactPreferredName”,
“title”: “Primary Contact Preferred Name”,
“type”: “string”
}
],
“count”: “”,
“data”: “${customers}”,
“emptyText”: “No records to display.”,
“events”: {
“loadData”: []
},
“name”: “grid0”,
“style”: {},
“type”: “grid”
}
],
“name”: “col4”,
“style”: {
“top”: “10px”
},
“type”: “col”
}
],
“name”: “row1”,
“type”: “row”
}
],
“events”: {
“load”: []
},
“name”: “Search Customer”
}

Thanks for providing the data! It helped me reproduce the problem - turned out to be a cache invalidation issue. We will address the problem with a hotfix later today.

1 Like

Thank you for your help, I can confirm it is working as expected for me now.