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
5 Answers, 1 is accepted
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
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.
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
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>
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.
- 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.
- 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