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

radtooltip deattach bug

1 Answer 70 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Alvaro
Top achievements
Rank 1
Alvaro asked on 29 Aug 2008, 03:00 PM
Hi there,


Im currently using radtooltip with a templated databinded button, the event must check some and shows the tooltip, everything works ok, but when another button fires the event and the condition does not match the tooltip still appearing, I digg on the demos site and find this http://demos.telerik.com/ASPNET/Prometheus/ToolTip/Examples/ShowEvent/DefaultCS.aspx im trying to implement the js code described for that situation but the object SYS throws an exception, do you have any other solution for that bug,

thanks in advance

AV.

here is the code:

<telerik:RadGrid ID="rgPersonasBloqueadas" runat="server" AllowPaging="True" AllowSorting="True" 
        GridLines="None" ShowGroupPanel="True" OnGroupsChanging="rgPersonasBloqueadas_GroupsChanging" 
        OnPageIndexChanged="rgPersonasBloqueadas_PageIndexChanged"   
        OnSortCommand="rgPersonasBloqueadas_SortCommand"   
        onitemcommand="rgPersonasBloqueadas_ItemCommand"   
        onitemdatabound="rgPersonasBloqueadas_ItemDataBound">  
        <MasterTableView> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridTemplateColumn UniqueName="TemplateColumn">  
                    <ItemTemplate> 
                        <asp:Button ID="btnMostrarCliente" runat="server" CausesValidation="false" CommandName="Select" CommandArgument='<%# obtenerCriterio(Eval("Identificacion"),Eval("CodigoAlmacen"))%>' Text="..."/>                          
                        <telerik:RadToolTip ID="rttMensaje" runat="server" Skin="Vista" ManualClose="true" ContentScrolling="Auto" RelativeTo="Element" Width="250px" Height="50px" Sticky="true" IsClientID="true"></telerik:RadToolTip> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn>                  
            </Columns>              
        </MasterTableView> 
        <ClientSettings AllowDragToGroup="True">  
        </ClientSettings> 
        <FilterMenu EnableTheming="True">  
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </FilterMenu> 
    </telerik:RadGrid>         
the code behind of item command
 protected void rgPersonasBloqueadas_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)  
    {  
        switch (e.CommandName)  
        {  
            case "Select":  
                GridDataItem item = e.Item as GridDataItem;  
                if (!clienteBloqueado(e.CommandArgument.ToString()))  
                {  
                    actualizarCache(e.CommandArgument.ToString());  
                    cambiarColor(e);  
                    RadWindow rnd = new RadWindow();  
                    rnd.ID = "rwInfoUsuario";  
                    rnd.Modal = true;  
                    rnd.VisibleOnPageLoad = true;  
                    rnd.Behaviors = WindowBehaviors.Close | WindowBehaviors.Move;  
                    rnd.Width = Unit.Pixel(800);  
                    rnd.Height = Unit.Pixel(600);  
                    rnd.NavigateUrl = "~/Paginas/InfoUsuario.aspx?ID=" + e.CommandArgument.ToString();  
                    rwmVentana.Windows.Add(rnd);  
                }  
                else if (item["UsuarioEnUso"].Text != HttpContext.Current.User.Identity.Name)  
                {                      
                    ((RadToolTip)e.Item.FindControl("rttMensaje")).TargetControlID = ((Button)e.Item.FindControl("btnMostrarCliente")).ClientID;  
                    ((RadToolTip)e.Item.FindControl("rttMensaje")).Text = "El usuario " + item["UsuarioEnUso"].Text + " se encuentra llamando actualmente a este cliente.";  
                    ((RadToolTip)e.Item.FindControl("rttMensaje")).Show();  
                    ((Button)e.Item.FindControl("btnMostrarCliente")).Enabled = false;  
                }                  
                break;  
        }  
    } 

1 Answer, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 01 Sep 2008, 08:36 AM
Hello Alvaro,

We are not very sure where the problem is, but looking at your code we notice that you call the RadToolTip's Show() method if one of the possible conditions is true.

The implementation of the Show() method simply sets the tooltip's VisibleOnPageLoad property to true. Since property state is maintained in the ViewState, next time you reload the page, it will still cause the tooltip to be shown. We logged this behavior for fixing, as it is not intuitive.

For the time being, as a workaround, we suggest setting the property to false in the beginning of your
rgPersonasBloqueadas method.

((RadToolTip)e.Item.FindControl("rttMensaje")).VisibleOnPageLoad = false;


Sincerely yours,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ToolTip
Asked by
Alvaro
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Share this question
or