RadInputManager inside an ASCX used in RadGrid

12 posts, 2 answers
  1. francesco
    francesco avatar
    8 posts
    Member since:
    Sep 2008

    Posted 19 Nov 2008 Link to this post

    HI, i have a page containing a radGrid (see below)

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="rdgUsers">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="rdgUsers" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
            <telerik:RadGrid ID="rdgUsers" runat="server" Skin="EPSomacis" EnableEmbeddedSkins="false"   
                GridLines="None" AllowPaging="True" AllowSorting="True" Width="97%" AutoGenerateColumns="False" 
                ShowStatusBar="true"    OnNeedDataSource="rdgUsers_NeedDataSource"  OnDeleteCommand="rdgUsers_DeleteCommand">  
                <MasterTableView GridLines="None" Width="100%" CommandItemDisplay="Top" DataKeyNames="UserId">                                
                                    <CommandItemSettings  AddNewRecordText="Add new user"/>  
                    <Columns>                                     
                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType=ImageButton   EditImageUrl="..\images\DataEditing\Edit.gif" />                      
                        <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" ButtonType=ImageButton CommandName="Delete" ImageUrl="..\images\DataEditing\Delete.gif" ConfirmDialogType=Classic ConfirmText="Delete user?" /> 
                        <telerik:GridBoundColumn UniqueName="UserName" HeaderText="User Name" DataField="UserName">  
                            <HeaderStyle Width="80px"></HeaderStyle> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn UniqueName="FirstName" HeaderText="First Name" DataField="FirstName">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn UniqueName="LastName" HeaderText="Last Name" DataField="LastName">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn UniqueName="Email" HeaderText="e-mail" DataField="Email">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn UniqueName="IsLockedOut" HeaderText="Locked" DataField="IsLockedOut">  
                        </telerik:GridBoundColumn>                      
                    </Columns> 
                    <EditFormSettings UserControlName="UserDetails.ascx" EditFormType="WebUserControl" > 
                          
                    </EditFormSettings> 
                </MasterTableView> 
            </telerik:RadGrid> 

    The control UserDetail.ascx contains a RadInputManager to validate an email

    <telerik:RadInputManager ID="RadInputManager1" runat="server" Skin="Vista" >                                                      
              
        <telerik:RegExpTextBoxSetting BehaviorID="RagExpBehavior1" IsRequiredFields="true" ValidationExpression="^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" ErrorMessage="Invalid Email" >   
            <TargetControls> 
                <telerik:TargetInput ControlID="txtEmail" /> 
            </TargetControls> 
        </telerik:RegExpTextBoxSetting> 
     
    </telerik:RadInputManager> 
     
    <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="1" rules="none" style="BORDER-COLLAPSE: collapse">  
        <tr > 
            <td colspan="2" align=center><b>User data</b></td>  
        </tr> 
        <tr> 
            <td colspan="2">&nbsp;</td> 
        </tr> 
        <tr> 
            <td> 
                <table id="Table3" cellspacing="1" cellpadding="1" width="100%" border="0">               
                    <tr> 
                        <td align=left>First Name</td> 
                        <td align=left>  
                            <asp:TextBox id="txtFirstName" Text='<%# DataBinder.Eval( Container, "DataItem.FirstName") %>' runat="server" tabIndex=0 Width="339px">  
                            </asp:textbox> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td align=left>Last Name</td> 
                        <td align=left>  
                            <asp:TextBox id="txtLastName" Text='<%# DataBinder.Eval( Container, "DataItem.LastName") %>' runat="server" tabIndex=1 Width="339px">  
                            </asp:textbox>                        
                        </td> 
                              
                    </tr>                 
                    <tr> 
                        <td align="left">Email</td> 
                        <td align="left">                     
                            <telerik:RadTextBox  ID="txtEmail" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.Email") %>' TabIndex="2" Width="339px" Skin="Vista" />                          
                        </td> 
                    </tr> 
                  </table> 
                </td> 
              </tr> 
            </table> 

    The problem is that when i load my page the browser return this error:

    Sys.ScriptLoadFailedException: The script 'http://localhost/ScriptResource.axd?d=B9dLJQn8tKI75sMhQN1Goymy0gZeoFrfbd-uYPQe8sLsz3sg1Kg_-lmSa6vAqKH4ZjdtQROP1pFTEFpjvDSTxGmv-Z0dIlIoQug9SKAtFNk1&t=ffffffff8c5d3c2e' contains multiple calls to Sys.Application.notifyScriptLoaded(). Only one is allowed.
    Source file: http://localhost/ScriptResource.axd?d=cC-xi9-T7162CKMLw41vPFxPIJzWcgP5AmPWl0Nf_sMwuiMP-Wub3jn-9wPGNZB64eQevVjlTlCyXbYh6R93HErsIR9pLLq2dReuLGJGLsudfuXgCj6a6xeK6Z9Qtjjb0&t=ffffffff901937ce
    Row: 1266

    Anyone could help me?

    Thanks
       Francesco
  2. Answer
    Plamen Peshev
    Admin
    Plamen Peshev avatar
    886 posts

    Posted 20 Nov 2008 Link to this post

    Hello francesco,


    Indeed we must admit there is an issue with the RadInputManager control. The issue will be fixed for the service pack (Q3 SP1) coming out next week.  Please excuse us for the inconvenience.

    Your Telerik points have been updated.


    Sincerely yours,
    Plamen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. francesco
    francesco avatar
    8 posts
    Member since:
    Sep 2008

    Posted 02 Dec 2008 Link to this post

    Hi,
       i download the SP1 and now the error disappears, but the control still not work correctly, the validation not work and no message appears over the textbox.

    Is there something i don't understand about the use of the InputManager?

    thanks
        Francesco
  4. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 05 Dec 2008 Link to this post

    Hi Francesco,

    I just tried this however validation worked on my end - I have attached small demo.

    I notice however that currently we do not have any setting for something like RequiredMessage and we need to add this definitely in our next service pack.

    Let me know how it goes.

    Greetings,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. francesco
    francesco avatar
    8 posts
    Member since:
    Sep 2008

    Posted 05 Dec 2008 Link to this post

    Hi Vlad,
      thanks for the example, it works on my side too, but I found where is the error.
    I use the RadTextBox
    <telerik:RadTextBox  ID="txtEmail" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.Email") %>' 
    TabIndex="3" Width="339px" Skin="Vista" />                         
    and with it the InputManager doesen't work, while with the standard asp:TextBox everything works, maybe an issue of the control?

    Let me know

    Thanks
       Francesco
  6. Answer
    Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 08 Dec 2008 Link to this post

    Hello Francesco,

    As explained in this help article the purpose of RadInputManager is to extend the asp.net textbox control. It does not work with RadTextBox or any other RadInput. If you want to use a RadTextBox you can validate it with an asp RegularExpressionValidator and RequiredFieldValidator.

    Let me know if I am missing something.

    Sincerely yours,
    Pavel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. bo
    bo avatar
    26 posts
    Member since:
    Jan 2009

    Posted 06 Feb 2009 Link to this post

    can this fire for the RequiredMessage as well?
  8. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 09 Feb 2009 Link to this post

    Hi Bo,

    I am not sure I understand your request. Could you elaborate it?

    All the best,
    Pavel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. Leon
    Leon avatar
    5 posts
    Member since:
    Jul 2008

    Posted 14 May 2009 Link to this post

    I have simular issue. The IsRequired validator won't work, if input manager is in an user control as web edit form in a RadGrid, when AJAX enabled. It's ok if AJAX was disabled. Actually, the validator is working, but we cannot see the mark in the text box if no value has been input.
  10. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 15 May 2009 Link to this post

    Hello Leon,

    Can you please verify that you are using the latest version 2009.1.402 of RadControls for ASP.NET AJAX in your project? Using the RadInputManager with IsRequired field settings should not be an issue in this configuration.

    In support of this statement you can take the following online demo of RadGrid which uses WebUserControl custom edit form for its nested table and modify it to 'inputify' the textboxes with RadInputManager dynamically as illustrated here.

    Kind regards,
    Sebastian
    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.
  11. Leon
    Leon avatar
    5 posts
    Member since:
    Jul 2008

    Posted 15 May 2009 Link to this post

    Hi Sebastian,

    Thanks  a lot for your quick response. I did checked the example, and added input manager into the user control. It turned out it was working perfectly in the example project. But still no luck in my own project, even the implementation are almost the same.

    After that, I used Firebug to inspect on the codes behavior, I did noticed that when I leave the textbox with no text filled, the css class of the textbox has been changed, with a css class name contained "ERROR" been added. But I did checked the CSS comes with the pages but couldn't find. If I disable the AJAX function from AJAXManager, I can see the css generated as a resource of page. I think this is the problem. Do you have any idea that why the css resources were not generated with page for input manager?

    Thanks again.

    Best regards,
    Leon
  12. Leon
    Leon avatar
    5 posts
    Member since:
    Jul 2008

    Posted 15 May 2009 Link to this post

    Just found a dirty solution, since the problem was caused by missing css resources of input manager, so I put a input manager control into the parent page, even no controls were used in this input manager, but this fixed the problem!!! Anyway, if you have any hint, it will be very helpful. Thanks,
    Leon
Back to Top