This is a migrated thread and some comments may be shown as answers.

Refresh Datalist onClose of RadWindow

2 Answers 12 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jessica B.
Top achievements
Rank 1
Jessica B. asked on 16 Jan 2019, 09:03 PM

I have a page where I need to:

  1. Display RadBinaryImages in a datalist.
  2. Click a button to open a RadWindow which contains a RadImageEditor to edit the image.
  3. User edits the image and clicks Save in the Editor, which saves and closes the window.
  4. When the window closes, refresh the datalist so the image is updated on the page.

I've got 1-3 working great, and am successfully able to send a command back to the parent page when the RadWindow closes. It's #4 that has me stumped. I'm working with a master page that has the RadAjaxManager on it, and on my content page there's a RadAjaxManagerProxy.

I'm able to change the Datalist to anything else if that helps. I just can't figure out how all of these pieces come together to make a part of my page refresh.

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 17 Jan 2019, 01:10 PM
Hello Jessica,

I can offer three approaches you can take:

  • Follow this demo and this article to use RadAjaxManager and capture its AjaxReqeust event in the content page. Note that the AJAX settings will then be global for any similar request you need to make where the ajax manager is the initiator.
  • Use a RadGrid and call its client-side .rebind() method.
  • Use a hidden button that is the AJAX initiator and in the script call __doPostBack("<%=theHiddenButton.UniqueID%>", "") to invoke a postback as if it were clicked. An alternative is document.getElementById("<%=theHiddenButton.ClientID%>").click() - the point of both being to invoke a postback from the button as if it were clicked by the user. This can also work if you have that button in an UpdatePanel or RadAjaxPanel, it does not require a RadAjaxManager/RadAjaxManagerProxy, and it will fire the Button.Click event for the specific instance you used.

 


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Jessica B.
Top achievements
Rank 1
answered on 17 Jan 2019, 08:39 PM

Thanks Marin!

I ended up switching my DataList to a RadListView and using your suggested method #2, calling the client-side .rebind(). That solved my issue really well, and now I have an excellent little image editor for my binary data images.

For anyone else reading this - to add a loading panel to the RadListView refresh, wrap the RadListView in a Panel, and in your RadAjaxManager/Proxy, name the panel as the AjaxUpdatedControl.

Tags
Ajax
Asked by
Jessica B.
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Jessica B.
Top achievements
Rank 1
Share this question
or