Update values in a content page are not working

5 posts, 1 answers
  1. Fabian Raul Jofre
    Fabian Raul  Jofre avatar
    29 posts
    Member since:
    Dec 2008

    Posted 16 Jun 2009 Link to this post

    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.
  2. Answer
    Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 18 Jun 2009 Link to this post

    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.
  3. Fabian Raul Jofre
    Fabian Raul  Jofre avatar
    29 posts
    Member since:
    Dec 2008

    Posted 18 Jun 2009 Link to this post

    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.-
  4. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 19 Jun 2009 Link to this post

    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.
  5. Fabian Raul Jofre
    Fabian Raul  Jofre avatar
    29 posts
    Member since:
    Dec 2008

    Posted 14 Sep 2009 Link to this post

    Yes it was correct.
    Sorry for answer to late.
Back to Top