Update different control on service request

6 posts, 0 answers
  1. Andrea Del Brocco
    Andrea Del Brocco avatar
    11 posts
    Member since:
    Jan 2003

    Posted 04 Aug 2010 Link to this post

    Hi, i am using the xmlhttp panel to update a html detail view on row click in a grid.

    function rowSelected(sender, args) {
                    var key = args.getDataKeyValue("IdAnagrafica");
                    var panel = $find("<%= RadXmlHttpPanel1.ClientID %>");
                    panel.set_value(key);
                    editedRow = args.get_itemIndexHierarchical();               
                }

    It's works fine, but i have to update a toolbar server side (ascx) according to values.

    In

     

     

     

    XmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)

     

    i set the values for toolbar but at runtime i have no results.

    i have tried client side to update with ajax manager the control in  

    function OnClientResponseEnded(panel, args) {

    but in that way i have no content at all in xmlhttp panel without have the toolbar changed.

    Is there any way to do this ?

    thanks in advice
    Andrea


  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 09 Aug 2010 Link to this post

    Hi Andrea,

    I am not quite sure that I understood your scenario, but in general, you can wrap the DetailsView and the toolbar in a RadXmlHttpPanel and they will be updated when you call the panel's set_value client-side method.

    I hope this helps.

    Kind regards,
    Fiko
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andrea Del Brocco
    Andrea Del Brocco avatar
    11 posts
    Member since:
    Jan 2003

    Posted 10 Aug 2010 Link to this post

    My scenario is simple

    i have a toolbar (ascx) , a grid and a panel used as a detail view of the item selected.

    when i select a item in a grid i show the detail and depending on the type pass some information to show or not a server tags in toolbar ascx.

    in function XmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)

    i set  a panel value and i want to call a  method on an ascx to enable or disable some buttons.

    If i use a server side onChangeItem in the grid with postback the code runs well but i wont not to use the server side onitemchanged grid event.













  5. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 13 Aug 2010 Link to this post

    Hello Andrea,

    I prepared a sample based on the provided information. Could you please check it and let me know whether it helps. In case that your scenario is different, could you please rework it, open a new support ticket and send it back? I will rework int in order to make it to work and send it back as soon as possible.

    Best wishes,
    Fiko
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Andrea Del Brocco
    Andrea Del Brocco avatar
    11 posts
    Member since:
    Jan 2003

    Posted 18 Aug 2010 Link to this post

    I'll try to set user control in the same RadXmlHttpPanel my structure is below, I have a master with 2 contetn one for ribbon one for a list with a preview panel.
    so the user control i have to update is non in the RadXmlhttpPanel.
    Thanks 
    Andrea
     

     

    <

     

     

    asp:Content ID="Content1" ContentPlaceHolderID="RibbonPlaceHolder" runat="server">

        <

     

     

    ucRibbon:ListaAnagrafica ID="ribbon" runat="server" OnCommandFired="ribbonAnagraficaCommandFired" />

     

    </

     

     

    asp:Content>

     

    <

     

     

    asp:Content ID="Content2" ContentPlaceHolderID="MainPagePlaceHolder" runat="server">

     

     

     

     

     

     

     

    <telerik:RadSplitter ID="radPagePanel" runat="server" Orientation="Horizontal" BorderSize="0" BorderWidth="0" CssClass="radContainer" OnClientResized="InternalSplitterLoaded">

     

     

     

     

     

     

     

    <telerik:RadPane CssClass="GridContainer" ID="radPanelGrid" runat="server" BorderStyle="None" Scrolling="None" Height="376px">

     

     

     

        <telerik:RadGrid ID="gridListaAnagrafica" runat="server" />

     

     

     

     

     

     

     

    </telerik:RadPane>

     

     

     

     

     

     

     

    <telerik:RadPane ID="radPaneScheda" runat="server" BorderStyle="None" Scrolling="None" CssClass="schedaContainer">

     

     

     

     

     

     

     

    <div>

     

     

     

     

     

     

     

    <telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" OnServiceRequest="XmlHttpPanel_ServiceRequest" OnClientResponseEnded="OnClientResponseEnded" RenderMode="Block">

     

     

     

     

     

     

     

    <div class="miniScheda">

     

     

     

     

     

     

     

    <div class="photo">

     

     

     

     

     

     

     

    <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" AutoAdjustImageControlSize="false" Width="90px" Height="110px" Visible="False" />

     

     

     

     

     

     

     

    </div>

     

     

     

     

     

     

     

    <div class="data">

     

     

     

     

     

     

     

    <asp:Literal ID="Literal1" runat="server"></asp:Literal>

     

     

     

     

     

     

     

    </div>

     

     

     

     

     

     

     

    </div>

     

     

     

     

     

     

     

    </telerik:RadXmlHttpPanel>

     

     

     

     

     

     

     

    </div>

     

     

     

     

     

     

     

    </telerik:RadPane>

     

     

     

     

     

     

     

    </telerik:RadSplitter>

     

    </

     

     

    asp:Content>

     

  7. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 20 Aug 2010 Link to this post

    Hello Andrea,

    Thank you for the additional information.

    This scenario is not supported by the XmlHttpPanel for two reasons:
    • The ViewState will not be updated, and on the next postback the control updated by the XmlHttpPanel will return to its last state in the ViewState. The XmlHttpPanel uses ASP.NET callbacks to update its content, which means that the ViewState will not be sent from the server to the client, and the old values will remain stored there.
    • The XmlHttpPanel updates only the part of the page, that lies within it. Since the toolbar (the ascx) is outside the panel, the changes will not take effect.
    This being said, you have two options to solve the issue:
    1. Place the toolbar in another XmlHttpPanel and handle the OnClientResponseEnded of the first XmlHttpPanel to initiate another request to update the toolbar. Keep in mind that the toolbar control should not execute any server side events, because the content of the XmlHttpPanel will be reverted to the latest state of the controls saved in the ViewState.
    2. The second, which I think is better, is to use RadAjaxManager to update different parts of the page simultaneously. I believe this approach is better than the previous, since it only does a single request to the server (which is lighter than two requests with the XmlHttpPanel), and you get the flexibility of the ajax postbacks (ViewState is updated, server events are executed, and so on).

    Kind regards,
    Pero
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017