Ajax Panel inside RadGrid

5 posts, 0 answers
  1. Andy Spears
    Andy Spears avatar
    9 posts
    Member since:
    Nov 2005

    Posted 14 Dec 2009 Link to this post

    I'm using a custom UC inside a RadGrid's EditItemTemplate tag:
    <telerik:RadAjaxPanel runat="server"
        <asp:TextBox runat="server" ID="useridTextbox" MaxLength="3" Width="25px"></asp:TextBox> 
        <asp:ImageButton runat="server" ID="checkNameImageButton" ImageAlign="AbsMiddle" ImageUrl="~/Images/checknames.gif" /> 
    </telerik:RadAjaxPanel> 

    The UC has a button (checkNameImageButton) that does a server-side lookup to verify the entry against Active Directory.  I would like to have it so when the user clicks the checkNameImageButton, only the ajax panel in the UC does a callback.  Currently it appears that the grid is what initiates the callback.  Is it possible to have the Ajax Panel initiate the callback when it is inside a RadGrid?

    Thanks in advance
  2. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 15 Dec 2009 Link to this post

    Hi Andy,

    I suggest you review the following articles which elaborate on this subject and let me know if they help you to achieve the desired functionality:
    RadAjax and WebUserControls
    Loading User Controls

    Greetings,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Andy Spears
    Andy Spears avatar
    9 posts
    Member since:
    Nov 2005

    Posted 15 Dec 2009 Link to this post

    The RadAjaxManagerProxy seems to be the solution I was looking for, but it's causing a problem.  My UC looks like the following:
    <telerik:RadAjaxManagerProxy runat="server" ID="RadAjaxManagerProxy1">  
    </telerik:RadAjaxManagerProxy> 
     
    <asp:TextBox runat="server" ID="useridTextbox" MaxLength="3" Width="25px"></asp:TextBox> 
    <asp:ImageButton runat="server" ID="checkNameImageButton" ImageAlign="AbsMiddle" ImageUrl="~/Images/checknames.gif" ToolTip="Verify User ID" OnClick="checkNameImageButton_Click" /> 
    &nbsp;&nbsp;<ad:ADViewUser runat="server" ID="ADViewUser1" /> 
    The ADViewUser UC contains a single Label, so nothing fancy.  In the Page_Load event, I'm adding the ajax setting:
    RadAjaxManagerProxy1.AjaxSettings.AddAjaxSetting( checkNameImageButton, ADViewUser1.DisplayNameLabel ); 
    The AjaxManagerProxy is now wrapping a <div> tag around my ADViewUser UC which means the display is now messed up.  The Textbox, ImageButton, and the ADViewUser's Label should all appear on a single line, but with the div wrapping the Label, it is displayed on 2 lines.  Is there anyway around this?
  4. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 16 Dec 2009 Link to this post

    Hi Andy ,

    To achieve the desired functionality, you should set UpdatePanelsRenderMode property to the RadAjaxManager itself to control the render mode for all ajaxified controls. You can have values Block (the default value) and Inline

    For more information, please refer to this help article:
    Render modes

    Regards,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Andy Spears
    Andy Spears avatar
    9 posts
    Member since:
    Nov 2005

    Posted 16 Dec 2009 Link to this post

    Thanks, that is exactly what I needed.
Back to Top