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

Update values in a content page are not working

4 Answers 91 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Fabian Raul Jofre
Top achievements
Rank 2
Fabian Raul Jofre asked on 16 Jun 2009, 03:53 PM

Hello,
 I have a project using master page and Ajax.
In the master page i  use RadComboBox to select language of my application, for example English to Spanish.
I have a problem when I try to change a language from the RadComboBox.
The page of the ContentPlaceHolder contain RadGrid, and everything function ok, but not update the values of the RadGrid Header-Text control from one language to another.

This is a part of the code of master page:
*****************

<

 

asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

 

 

<telerik:RadAjaxPanel ID="RadAjaxPanel10" runat="server">

 

 

<telerik:RadComboBox Width="250px" ID="cmbMultiLenguage" runat="server" ZIndex="99999" Skin="Forest" Font-Size="11px" AutoPostBack="true"/>

 

 

</telerik:RadAjaxPanel>

 

 

<asp:ContentPlaceHolder ID="Contenedor" runat="server">

 

 

 

 

 

</asp:ContentPlaceHolder>

 

 

 

*******************


This is a Part .aspx & .cs of the page (ContentPlaceHolder):

 *******************

 

<

 

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

 

 

 

<

 

telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px" Transparency="25">

 

 

<img src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;position:absolute;top:20%;left:45%;" />

 

</

 

telerik:RadAjaxLoadingPanel>

 

<

 

telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">

 

<

 

telerik:RadGrid AutoGenerateColumns="false" ID="RadGrid1" AllowFilteringByColumn="False" AllowSorting="true" ShowFooter="True" runat="server" AllowPaging="false" Skin="MyCustomSkin" EnableEmbeddedSkins="false" OnItemDataBound="RadGrid1_ItemDataBound" OnSortCommand="RadGrid1_SortCommand">

 

 

<ExportSettings OpenInNewWindow="true" ExportOnlyData="true">

 

 

<Excel Format="Html" FileExtension="XLS"/>

 

 

<Pdf PaperSize="Legal" />

 

 

</ExportSettings>

 

 

<ClientSettings>

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true"></Scrolling>

 

 

<ClientEvents OnGridCreated="GridCreated" />

 

 

</ClientSettings>

 

 

<MasterTableView>

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="fecha" HeaderText="Fecha" SortExpression="fecha" UniqueName="fecha" DataFormatString="{0:dd/MM/yyyy hh:mm:ss}" HeaderStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="totalapuesta" HeaderText="Total Apuesta" SortExpression="totalapuesta" UniqueName="totalapuesta" DataFormatString="{0:###,###,##0.00}" HeaderStyle-HorizontalAlign="Center" Aggregate="Sum"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="totalganancia" HeaderText="Total Ganancia" SortExpression="totalganancia" UniqueName="totalganancia" DataFormatString="{0:###,###,##0.00}" HeaderStyle-HorizontalAlign="Center" Aggregate="Sum"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="porcentaje" HeaderText="Porcentaje" SortExpression="porcentaje" UniqueName="porcentaje" DataFormatString="{0:0.00}" HeaderStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="cantMaq" HeaderText="Cant.Maq" SortExpression="cantMaq" UniqueName="cantMaq" HeaderStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="cantPuesto" HeaderText="Cant.Puesto" SortExpression="cantPuesto" UniqueName="cantPuesto" HeaderStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 

</

 

telerik:RadAjaxPanel>

 

</

 

asp:Content>

 

***********************
.cs code:
**********************

 

protected void Page_Load(object sender, System.EventArgs e)

 

{

BoxBegin.Title= GetRecursoCultura(

"reporte_mensual-boxtit1");

 

RadGrid1.MasterTableView.Columns[0].HeaderText = GetRecursoCultura(

"reporte_mensual-col0");

 

RadGrid1.MasterTableView.Columns[1].HeaderText = GetRecursoCultura(

"reporte_mensual-col1");

 

RadGrid1.MasterTableView.Columns[2].HeaderText = GetRecursoCultura(

"reporte_mensual-col2");

 

RadGrid1.MasterTableView.Columns[3].HeaderText = GetRecursoCultura(

"reporte_mensual-col3");

 

RadGrid1.MasterTableView.Columns[4].HeaderText = GetRecursoCultura(

"reporte_mensual-col4");

 

RadGrid1.MasterTableView.Columns[5].HeaderText = GetRecursoCultura(

"reporte_mensual-col5");

 

RadGrid1.MasterTableView.NoMasterRecordsText = GetRecursoCultura(

"comunes_Sin_datos");

 

}
**********************

Thank's if you can help me.

4 Answers, 1 is accepted

Sort by
0
Accepted
Iana Tsolova
Telerik team
answered on 18 Jun 2009, 02:37 PM
Hello Fabian,

I suggest that you use RadAjaxManager to ajaxify your application. To achieve it, remove the RadAjaxPanels wrapping the RadComboBox and the RadGrid and try the below ajax settings:

in the master page:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadAjaxManager1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
</telerik:RadAjaxManager> 

in the content page:
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadGrid1">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 

in the content  page code behind:
protected void Page_Load(object sender, EventArgs e)  
{  
    RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);  
    Control combo = this.Page.Master.FindControl("RadAjaxManager1");  
    manager.AjaxSettings.AddAjaxSetting(combo, RadGrid1);  

Find more about RadAjaxManager in Master/Content page scenario in the below online resource:
http://www.telerik.com/help/aspnet-ajax/ajxajaxmasterpage.html
http://www.telerik.com/help/aspnet-ajax/ajax-manager-proxy.html
http://www.telerik.com/help/aspnet-ajax/ajxmasterpageupdateeverywhere.html
http://www.telerik.com/help/aspnet-ajax/ajxaddajaxsettingsprogrammatically.html

I hope this helps.

Kind regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Fabian Raul Jofre
Top achievements
Rank 2
answered on 18 Jun 2009, 04:37 PM
Thank´s for the advise, I tried excaltly as you segust me. But I have the same problem.
The values of the header text not were updated.
If you have other choice i will really apreciate that.

tha´nks.-
0
Iana Tsolova
Telerik team
answered on 19 Jun 2009, 12:04 PM
Hi Fabian,

Could you please confirm that it works properly without any ajax at all? I would suggest that you try sending the master and the content pages so I could try replicating your scenario and issue on my end and find a proper solution for you.

Regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Fabian Raul Jofre
Top achievements
Rank 2
answered on 14 Sep 2009, 07:35 PM
Yes it was correct.
Sorry for answer to late.
Tags
Ajax
Asked by
Fabian Raul Jofre
Top achievements
Rank 2
Answers by
Iana Tsolova
Telerik team
Fabian Raul Jofre
Top achievements
Rank 2
Share this question
or