Help Registering RadMenuItems with the RadAjaxManager

4 posts, 0 answers
  1. Mark
    Mark avatar
    3 posts
    Member since:
    Dec 2008

    Posted 23 Dec 2009 Link to this post

    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
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 25 Dec 2009 Link to this post

    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.
  3. Mark
    Mark avatar
    3 posts
    Member since:
    Dec 2008

    Posted 30 Dec 2009 Link to this post

    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.
  4. T. Tsonev
    Admin
    T. Tsonev avatar
    2815 posts

    Posted 05 Jan 2010 Link to this post

    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.
Back to Top