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

[Solved] Help Registering RadMenuItems with the RadAjaxManager

3 Answers 101 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 23 Dec 2009, 04:15 PM
Hi,

I have a scenario where I need specific UI panels updated when the user clicks a related menu item. Sounds simple...drop a few panels on a page with a RadMenu that contains a seperate menu item for each, add a click event handler for the RadMenu to the code-behind for the page, and than use the RadAjaxManager configuration wizard to hook everything up...but I've not been able to get it to work without adding an AjaxSetting for the RadMenu itself to the RadAjaxManager. This in turn allows updating of all panel in response to a click of any menu item. Has anyone been able to get this to work or is it just not possible?

-mark

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 25 Dec 2009, 05:41 PM
Hello Mark,

I have attached a sample of one possible implementation of this requirement. Please, review it and let us know if there is some extra functionality that you need to add.


Best wishes,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Mark
Top achievements
Rank 1
answered on 30 Dec 2009, 08:20 PM
Peter,
Not sure I understand the example you sent...you are adding a single setting to the AjaxManager for the top-level menu that allows updating of all three panels in response to a user click of any menu item...this is exactly what I stated that I did not want to do. In my current implementation I have a RadMultiPage that has several views...each containing a single complex data-bound control. I also have a menu containing several menu items...each of which is linked by value to a data-bound control contained by a single view. In response to a user click of the menu item I only want the resulting callback to allow updating the linked control. I handle switching the active/selected view from the client so thats not the problem...the problem I want to solve is adding a setting to the AjaxManager for each RadMenuItem with its UpdateControls section having a single reference to the linked data-bound control.
0
T. Tsonev
Telerik team
answered on 05 Jan 2010, 10:41 AM
Hi Mark,

I think I know what you mean. This is not very easy to do, as RadAjaxManager works on the control level and not on the item level. We can still achieve the desired behavior, but not directly.

Our idea is to use hidden buttons to initiate the updates and associate each button with the respective control.

For example:

<telerik:AjaxSetting AjaxControlID="Button1">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="Label1" />
    </UpdatedControls>
</telerik:AjaxSetting>

The actual button is wrapped in a hidden div:

<div style="display: none;">
    <asp:Button runat="server" ID="Button1" />
</div>

And we trigger the update from itemClick:

<script type="text/javascript">
    function itemClick(s, e) {
        if (e.get_item().get_value() == "1")
            $get("Button1").click();
    }      
</script>

I'm attaching a sample page. Let us know if this helps.

Sincerely yours,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Menu
Asked by
Mark
Top achievements
Rank 1
Answers by
Peter
Telerik team
Mark
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or