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

Delete in RadListView from ToolTip

3 Answers 81 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 2
Steve asked on 26 Aug 2011, 05:14 AM
Similar to how a RadToolTipManager is used to insert a record into a RadGrid, I have a RadListView where the user clicks a button on a record to load a tooltip to see more info about the record, including some function buttons (namely, the "Delete" button).  Because other controls update both the listview and the tooltipmanager via ajax, both controls are included in RadAjaxManagerProxy ajax settings on the page.  When user clicks "Delete" in the tooltip, the record should be removed from the database, tooltip hidden, and parent listview updated.  Everything is working except for updating the listview.

How do you setup ajax settings so a button in the tooltip (loaded dynamically on tooltipmanager's AjaxUpdate event) can ajax update it's parent control?

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 26 Aug 2011, 01:12 PM
Hi Steve,

  The user control renders as a part of the main page, thus it can access JavaScript functions that reside in it. What I would suggest is that you declare one function that will perform an AJAX request via the RadAjaxManager with some custom argument (for example "FromTooltip") so that you can differentiate this request in the code-behind. Then in the AJAX settings you should add the ListView to the UpdatedControls collection of the setting, whose initiator is the RadAjaxManager (or create this setting, if it is not present already). In the code-behind you can check the argument and rebind the ListView.


Regards,
Marin
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Steve
Top achievements
Rank 2
answered on 26 Aug 2011, 03:02 PM
That's a good idea, but that didn't work either.  The "Delete" button in the tooltip has to first delete the record from the database on the server-side.  Then when the call has completed successfully, I have to inject javascript to call the InitiateAsyncRequest function that performs the ajax request (with RadAjaxManager is the initiator), so that means the Delete button has to have an ajax setting on a RadScriptBlock so I can get the script in there.  After doing all this, I was successfully able to initiate the request, handle in an AjaxRequest event handler, and call to update the listview.  But essentially, the request never seems to finish.  If you use loading panel, it never goes away.  If you try to do another action on screen that involves ajax, it hangs.  You have to clear it by F5 (or something similar that fully posts back the page).

This is driving me crazy.  Simple situation.  RadListView showing items, using RadToolTipManager to "show more".  Function available in the usercontrol showing in the tooltip that requires the "parent" RadListView to be refreshed, and I can't get it working.  Not good.
0
Steve
Top achievements
Rank 2
answered on 26 Aug 2011, 03:10 PM
Hold the phone, I think I may have figured it out.  In the tooltip usercontrol, instead of ajaxifying RadScriptBlock to inject script to call the InitiateAsyncRequest function, I took all AJAX settings out of the tooltip and used the ScriptManager to RegisterClientScriptBlock and, low and behold, it worked.

Still have to check it out to be sure, but I believe it's straight.  Thanks for the suggestion about RadAjaxManager.
Tags
ToolTip
Asked by
Steve
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Steve
Top achievements
Rank 2
Share this question
or