problem with position - RadToolTips with SumaryValidator in Grid

2 posts, 0 answers
  1. Carlos
    Carlos avatar
    1 posts
    Member since:
    Dec 2011

    Posted 19 Dec 2011 Link to this post

    Hello.

    I have one radgrid, when click in button for insert, the tooltips show me validationsumary, but when click button in update, the position of tooltips is not correct. And the tooltips insert to set position after click in button insert.

    I will have to set isClientId = true.... after this the problem with position for radtooltips

    Is this my code:

    <telerik:RadToolTip runat="server" ID="RadToolTipInsert" Position="TopLeft"
                            ShowEvent="FromCode" Width="400px" RelativeTo="Element"
                                    OnClientBeforeShow="CheckIfShowInsert" Skin="Sitefinity"
                                    ManualClose="True" Animation="Fade" EnableShadow="True"
                                    Title="<span class='MsgTextoToolTip'><b>  No es posible guardar debido a lo siguiente:</b></span> "
                                    RenderInPageRoot="True">
                            <asp:ValidationSummary ID="valSumaryInsert" runat="server"
                                    ValidationGroup="insert_group" />
                            </telerik:RadToolTip>
                            
                         <telerik:RadToolTip ID="RadToolTipUpdate" runat="server" Animation="Fade"
                                    EnableShadow="True" ManualClose="True" OnClientBeforeShow="CheckIfShowUpdate"
                                    Position="TopLeft" RelativeTo="Element" ShowEvent="FromCode" Width="400px"
                                    Title="<span class='MsgTextoToolTip'><b>  No es posible guardar debido a lo siguiente:</b></span> "
                                    RenderInPageRoot="True" IsClientID="True" TargetControlID="ToolTipsPositionEditMode"
                                     
                                    >
                                     
                                    <asp:ValidationSummary ID="valSummaryUpdate" runat="server"
                                     ValidationGroup="update_group" />
                                     
                                </telerik:RadToolTip>
     
     
     
     
     
    <EditItemTemplate>
                                                            <asp:ImageButton ID="btnUpdate" runat="server" BorderStyle="None"
                                                                BorderWidth="0px" commandname="Update"
                                                                ImageUrl="~/Imagenes/PedidoExpress/diskyellow16.png"
                                                                ValidationGroup="update_group" onclientclick="ShowTooltipUpdate();"
                                                                ToolTip="Guardar los cambios realizados" />
     
     <InsertItemTemplate>
                                                             
                                                            <asp:ImageButton ID="btnInsert" runat="server" BorderStyle="None"
                                                                BorderWidth="0px" commandname="PerformInsert"
                                                                ImageUrl="~/Imagenes/PedidoExpress/diskgreen16.png"
                                                                ValidationGroup="insert_group" onclientclick="ShowTooltipInsert()"
                                                                ToolTip="Agregar beneficiario al pedido" />
    function CheckIfShowInsert(sender, args) {
                       var summaryElem = document.getElementById("<%= valSumaryInsert.ClientID %>");
                       if (summaryElem.style.display == "none") {
                           args.set_cancel(true);
                       }
                   }
     
                   function ShowTooltipInsert() {
                   window.setTimeout(function () {
                       var tooltip = $find("<%= RadToolTipInsert.ClientID %>")
                       tooltip.show();
                   }, 10);
                   }
     
                   function CheckIfShowUpdate(sender, args) {
                        
                       var summaryElem = document.getElementById("<%= valSummaryUpdate.ClientID %>");
                        
                       if (summaryElem.style.display == "none") {
                           //API: if there are no errors, do not show the tooltip
                           args.set_cancel(true);
                       }
                   }
                   function ShowTooltipUpdate() {
                        
                       var tooltip = $find("<%= RadToolTipUpdate.ClientID %>")
                       
                      
                       setTimeout( function ()
                       {
                            tooltip.show();
                       }, 20);
                   }


    i attach 2 images, the image one is working fine with insert, but image two a three is the problem i have.

    Thank..

    Bets Regards,
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 20 Dec 2011 Link to this post

    Hi Carlos,

    I am not sure what is your exact setup, yet it seems that the target you set to the RadToolTip does not exisp - i.e. you set it to be the clientID so the RadToolTip looks for an HTML element with such an id, while such does not exist - controls placed in an INaming container have different IDs than the ones you set in the code-behind to avoid duplicating them. A prime example for this is any grid. Please examine the following demo which shows how to use separate RadToolTips in a grid: http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipversustooltipmanager/defaultcs.aspx. Note the second gridview - each row has its tooltip that uses server ids for its targets. In case you need to use only one tooltip outside of the grid I advise you examine the following sticky thread on setting its new target control (as it does not have one in the markup): http://www.telerik.com/community/forums/aspnet-ajax/tooltip/changing-targetcontrol-on-the-client.aspx. You can easily pass a reference to the new target control to the client-side handler via the this keyword in the parentheses of the OnClientClick handler.


    Best wishes,
    Marin
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top