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

RadGrid Problems using radAjaxPanel and MasterPage contents

5 Answers 160 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pharsat
Top achievements
Rank 2
Pharsat asked on 18 Oct 2011, 05:23 PM
Hi i looking for a some help.
I have a master page whit the next controls
<div class="Contenedor_Principal">
         <asp:ScriptManager ID="ScriptManager1" runat="server">
         </asp:ScriptManager>
         <radA:RadAjaxManager ID="RadAjaxManager2" runat="server">
             <AjaxSettings>
                 <radA:AjaxSetting AjaxControlID="RadAjaxPanel1">
                     <UpdatedControls>
                         <radA:AjaxUpdatedControl ControlID="RadAjaxPanel1" />
                     </UpdatedControls>
                 </radA:AjaxSetting>
             </AjaxSettings>
         </radA:RadAjaxManager>
         <radA:RadAjaxPanel ID="RadAjaxPanel1" runat="server" ClientEvents-OnRequestStart="OnRequestStart"
             LoadingPanelID="AjaxLoadingPanel1">
             <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
             </asp:ContentPlaceHolder>
         </radA:RadAjaxPanel>
         <radA:AjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server">
             <asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="~/Imagenes/Aplicacion/ajax-loader2.gif" />
         </radA:AjaxLoadingPanel>
     </div>

then i have a aspx file based in this masterpage, into the content place holder i have a simple form:
<table>
                    <tr>
                        <td align="left">
                            <asp:Label ID="Label2" runat="server" CssClass="ElementoDeFormulario_Etiqueta" Text="Comandos"></asp:Label>
                            <asp:ImageButton ID="btnEliminar" runat="server" ImageUrl="~/Imagenes/Iconos/Eliminar.png"
                                OnClick="btnEliminar_Click" OnClientClick="return Confirmar('¿Seguro desea eliminar los registros seleccionados?')" />
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <radG:RadGrid ID="dgListaPrincipal" runat="server" AutoGenerateColumns="False" GridLines="None"
                                AllowPaging="True" OnItemCommand="dgListaPrincipal_ItemCommand" OnPageIndexChanged="dgListaPrincipal_PageIndexChanged"
                                PageSize="20" Skin="Office2007">
                                <MasterTableView>
                                    <RowIndicatorColumn Visible="False">
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                    </RowIndicatorColumn>
                                    <ExpandCollapseColumn Visible="False">
                                        <HeaderStyle Width="19px"></HeaderStyle>
                                    </ExpandCollapseColumn>
                                    <Columns>
                                        <radG:GridTemplateColumn UniqueName="TemplateColumn">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkSeleccion" runat="server" />
                                            </ItemTemplate>
                                        </radG:GridTemplateColumn>
                                        <radG:GridBoundColumn HeaderText="Identificación" UniqueName="column" DataField="pIdentficacion">
                                        </radG:GridBoundColumn>
                                        <radG:GridBoundColumn HeaderText="Tipo" UniqueName="column" DataField="pId_TiposDeDocumento.pNombre">
                                        </radG:GridBoundColumn>
                                        <radG:GridBoundColumn HeaderText="Nombre" UniqueName="column" DataField="pNombre">
                                        </radG:GridBoundColumn>
                                        <radG:GridBoundColumn HeaderText="Telefono 1" UniqueName="column" DataField="pTelefono_1">
                                        </radG:GridBoundColumn>
                                        <radG:GridBoundColumn HeaderText="@mail" UniqueName="column" DataField="pEmail">
                                        </radG:GridBoundColumn>
                                        <radG:GridButtonColumn ButtonType="ImageButton" HeaderText="Editar" UniqueName="jajaXD"
                                            ImageUrl="~/Imagenes/Iconos/Editar.png" CommandName="Editar">
                                        </radG:GridButtonColumn>
                                    </Columns>
                                </MasterTableView>
                                <PagerStyle Font-Underline="false" Mode="NextPrevAndNumeric" NextPageText="Siguiente"
                                    PrevPageText="Anterior" Position="TopAndBottom" />
                            </radG:RadGrid>
                        </td>
                    </tr>
                </table>

then, i am working in asp.net framework 4, and visual studio 2010 (under c#).
The problem is, when i do clic in the button "Editar" ocured this:
1) Testing in visualstudio whit IExplorer 9  = works fine
2) Testing in visualstudio whit mozillafirefox = Detalles de la excepción: System.FormatException:
3) Testing compiled files in a webserver using IExplorer 9 = the AjaxLoadingPanel1 view never finish (loading loading loading)
4) Testing compiled files in a webserver using mozillafirefox  =   Detalles de la excepción: System.FormatException:

i try to assess step by step in both navigators but both never entry in itemcomand event
i try to negate the ajax request using this:
<script type="text/javascript">
        function OnRequestStart(target, arguments) {
            try {
                if (arguments.EventTarget == "<%= dgListaPrincipal.UniqueID %>") {
                    arguments.EnableAjax = false;
                }
                else {
                    arguments.EnableAjax = true;
                }
            }
            catch (err) {
                //Handle errors here
            }
        }
    </script>

but i founded that arguments.EventTarget equals 'ctl00$ContentPlaceHolder1$dgListaPrincipal$ctl01$ctl04$ctl00'
i need execute code in the itemcommandevent (the best way with the visualization of the loading screen).

all this works fine if i execute proyect code whitout masterpage and radajaxpanel

thaks for reply e.e

5 Answers, 1 is accepted

Sort by
0
Pharsat
Top achievements
Rank 2
answered on 18 Oct 2011, 06:31 PM
Hi dears i founded that i add a new colum of button or linkbutton type and i put it to execute same code, Works!! unique it does not work whit image button type column.
any idea? (and yes i am using all whit panel and loading panel).
0
Pharsat
Top achievements
Rank 2
answered on 18 Oct 2011, 06:37 PM
hahaha
oh my sucess XD i dont know why but i put in Text atribute of Gridbuttoncolum of type imagebutton a at(.) and this works.
i compare the propierties of imagebuttoncolum and buttoncolum and the diferent atribute were imageurl and Text.
i will going to text in webserver.
0
Pharsat
Top achievements
Rank 2
answered on 18 Oct 2011, 07:07 PM
oh no u.u it doest not work please a help e.e
0
Accepted
Iana Tsolova
Telerik team
answered on 21 Oct 2011, 03:42 PM
Hello Cristian,

Try setting the page ClientIDMode to AutoID and see if it helps.
Additionally, reviewing your code I noticed that you are using the "classic" control, e.g. the predecessors of RadControls for ASP.NET AJAX. These controls are not supported any more and the development process on them finished before .NET 4.0 to be available. So it is expected that you hit some issues. I strongly recommend that you upgrade the project to RadControls for ASP.NET AJAX.

All the best,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Pharsat
Top achievements
Rank 2
answered on 21 Oct 2011, 03:56 PM
I managed to do it with the following code for your response thank you very much!
private void AjaxRedirect(string path)
        {
            if ((HttpContext.Current.Request.Form["httprequest"] == "true"))
            {
                HttpContext.Current.Response.StatusCode = 200;
                HttpContext.Current.Response.RedirectLocation = path;
                HttpContext.Current.Response.Write("<html></html>");
                HttpContext.Current.Response.End();
            }
        }

this implements before response.redirect line without delete resposponse.redirect line.
yes i plan to buy the aspx telerik.net controls but i'm from colombia and i need propose the buy of the product XD.
 Any way thank you very much.
Tags
Grid
Asked by
Pharsat
Top achievements
Rank 2
Answers by
Pharsat
Top achievements
Rank 2
Iana Tsolova
Telerik team
Share this question
or