Radgrid not updating

Rated 3.98/5 based on 718 customer reviews

I thought that updating an Update Panel from javascript was one of the most frequently asked question about ASP. The first article explains a very nice way to trigger the update of an Update Panel from Java Script, while the other two are very detailed overviews on the internals of how an Update Panel is updated.

NET Ajax, but even looking around a lot I didn't find a clean and polished solution for what should be a common task. NET Ajax extender for such a simple task, but after a few hours of Google-ing, I found a few nice articles on Ben Rush's blog, which is a very valuable source of knowledge on the internals of ASP. The only thing you need to do to refresh from javascript is to register a Button (hidden via CSS) Click event as async trigger for an Update Panal and then call the following method from your javascript method: Yes, that easy. But in my page I also had to pass a value to the Update Panel, so the button was not enough.

Need Data Source Dim Conn String As String = Configuration Manager.

Connection String Dim conn As Sql Connection = New Sql Connection(Conn String) Dim adapter As Sql Data Adapter = New Sql Data Adapter adapter.

Remember to set the Update Mode to Conditional, otherwise the Update Panel will always be refreshed, not only when there is a postback inside or when a trigger fires.

Using the Client ID property of the control will ensure that you get the right ID even if the control is inside a masterpage, a webcontrol, a repeater or whatever might change the ID.

Rad Grid fires the Need Data Source event each time it needs to be bound to a data source.

So I adapted a bit Ben's solution, and I add hidden text box, and update its value before calling the do Post Back method.

To implement that you need to add 4 "things" in your ASP. You need a textbox to store the value you want to pass over to the Update Panel, but you don't want to show it in the page, so it must be hidden via CSS.

If, at the time of the event, the Data Source property is not set to a valid data source object, the grid will not behave correctly.

In a Need Data Source event handler, you should prepare the data source (list of objects) for Rad Grid and assign it to the grid's Data Source property: Protected Sub Rad Grid1_Need Data Source(By Val source As Object, By Val e As Telerik.

Leave a Reply