This is a migrated thread and some comments may be shown as answers.
ToolTip and RadGrid Detail Table
1 Answer 42 Views
This is a migrated thread and some comments may be shown as answers.
Alejandro
Top achievements
Rank 1
Alejandro asked on 10 May 2011, 07:03 PM

Hello there!

I'm having an issue with ToolTipManager and RadGrid Detail Table, I programmatic add TargetControls, one control is a templatecolumn on mastertableview the other is also a templatecolumn on detail table same grid, first control triggers perfectly although when I hover template column item on detail table nothing happens.

I'm doing something like http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultvb.aspx sample, I mean, I want to load dynamic data on each ToolTip.

Need some advice.

Thanks.

Alex.

Private Sub UpdateToolTip(ByVal elementID As String, ByVal panel As UpdatePanel)
    Dim ctrl As Control = Page.LoadControl("WUC_PolizaDetail.ascx")
    panel.ContentTemplateContainer.Controls.Add(ctrl)
    Dim details As WUC_PolizaDetail = DirectCast(ctrl, WUC_PolizaDetail)
    details.ProductID = elementID
End Sub
 
Protected Sub OnAjaxUpdate(ByVal sender As Object, ByVal args As ToolTipUpdateEventArgs) Handles RadToolTipManager1.AjaxUpdate, RadToolTipManager2.AjaxUpdate
    Me.UpdateToolTip(args.Value, args.UpdatePanel)
End Sub
 
Protected Sub Grid_2_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles Grid_2.ItemDataBound
    Dim target2 As Control
    If e.Item.ItemType = GridItemType.Item OrElse e.Item.ItemType = GridItemType.AlternatingItem Then
        Dim target As Control = e.Item.FindControl("tooltip")
 
 
        If e.Item.OwnerTableView.Name = "Detail_Table" AndAlso ((e.Item.ItemType = GridItemType.Item) OrElse (e.Item.ItemType = GridItemType.AlternatingItem)) Then
            Dim item As GridDataItem = e.Item
            target2 = item.FindControl("tooltip_detail")
        End If
 
        If Not [Object].Equals(target, Nothing) Then
            If Not [Object].Equals(Me.RadToolTipManager1, Nothing) Then
                Me.RadToolTipManager1.TargetControls.Add(target.ClientID, (TryCast(e.Item, GridDataItem)).GetDataKeyValue("POLIZA").ToString(), True)
            End If
        End If
 
        If Not [Object].Equals(target2, Nothing) Then
            If Not [Object].Equals(Me.RadToolTipManager2, Nothing) Then
                Me.RadToolTipManager2.TargetControls.Add(target2.ClientID, TryCast(e.Item, GridDataItem).GetDataKeyValue("ID_RECIBO").ToString(), True)
            End If
        End If
    End If
End Sub
 
Protected Sub Grid_2_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles Grid_2.ItemCommand
    If e.CommandName = "Sort" OrElse e.CommandName = "Page" Then
        RadToolTipManager1.TargetControls.Clear()
        RadToolTipManager2.TargetControls.Clear()
    End If
End Sub
        <table>
            <tr>
                <td>
                    <br />
                    <asp:SqlDataSource ID="SqlRecibosData" runat="server" ConnectionString="<%$ ConnectionStrings:IVConnectionString %>"
                        SelectCommand="SELECT CONS_RECIBOS_CONCILIA.POLIZA, CONS_RECIBOS_CONCILIA.CLAVEAGENTE AS AGENTE, CONS_RECIBOS_CONCILIA.CLIENTE AS ASEGURADO, CASE ISNULL(dbo.ENDOSOS.ENDOSO , 'LA') WHEN 'LA' THEN CAST(dbo.CONS_RECIBOS_CONCILIA.ENDOSO AS VARCHAR) ELSE dbo.ENDOSOS.ENDOSO END AS ENDOSO, CASE CAST(TIPOCAMBIO.MONEDA AS VARCHAR) WHEN '1' THEN 'PESOS' WHEN '2' THEN 'DOLARES' WHEN '3' THEN 'EUROS' WHEN '4' THEN 'UDIS' END AS MONEDA FROM (SELECT FOLIO_OT, ENDOSO, FECHA_DESCARTE FROM (SELECT FOLIO_OT, 0 AS ENDOSO, FECHA_DESCARTE FROM POLIZAS AS POLIZAS_1 UNION SELECT FOLIO_OT, CONSECUTIVO AS ENDOSO, FECHA_DESCARTE FROM ENDOSOS AS ENDOSOS_1) AS derivedtbl_1) AS DESCARTE RIGHT OUTER JOIN ENDOSOS RIGHT OUTER JOIN CONS_RECIBOS_CONCILIA ON ENDOSOS.FOLIO_OT = CONS_RECIBOS_CONCILIA.FOLIO_OT AND ENDOSOS.CONSECUTIVO = CONS_RECIBOS_CONCILIA.ENDOSO ON DESCARTE.FOLIO_OT = CONS_RECIBOS_CONCILIA.FOLIO_OT AND DESCARTE.ENDOSO = CONS_RECIBOS_CONCILIA.ENDOSO LEFT OUTER JOIN CONS_GRUPOS ON CONS_RECIBOS_CONCILIA.ID_CONTRATANTE = CONS_GRUPOS.ID_CLIENTE LEFT OUTER JOIN CORRESPONSALES RIGHT OUTER JOIN POLIZAS ON CORRESPONSALES.ID_CORRESPONSAL = POLIZAS.ID_CORRESPONSAL1 ON CONS_RECIBOS_CONCILIA.FOLIO_OT = POLIZAS.FOLIO_OT LEFT OUTER JOIN TIPOCAMBIO RIGHT OUTER JOIN COB_LIQUIDACION ON TIPOCAMBIO.ID_TIPCAMBIO = COB_LIQUIDACION.TIPOCAMBIO ON CONS_RECIBOS_CONCILIA.REFER_LIQUIDA = COB_LIQUIDACION.ID_LIQUIDACION LEFT OUTER JOIN CONS_DIF_CONCILIACION ON CONS_RECIBOS_CONCILIA.POLIZA = CONS_DIF_CONCILIACION.POLIZA AND CONS_RECIBOS_CONCILIA.ENDOSO = CONS_DIF_CONCILIACION.ENDOSO AND CONS_RECIBOS_CONCILIA.NUMPAGO = CONS_DIF_CONCILIACION.NUM_PAG AND CONS_RECIBOS_CONCILIA.FOLIO_ASEG = CONS_DIF_CONCILIACION.FOLIO_ASEG AND CONS_RECIBOS_CONCILIA.OFICINA = CONS_DIF_CONCILIACION.OFICINA WHERE (CONS_RECIBOS_CONCILIA.ID_ASEGURADORA = @Aseguradora) AND (CONS_RECIBOS_CONCILIA.CLAVEAGENTE = @Agente) ORDER BY CONS_RECIBOS_CONCILIA.POLIZA, ENDOSO">
                        <SelectParameters>
                            <asp:Parameter Name="Aseguradora" />
                            <asp:Parameter Name="Agente" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlRecibosDetail" runat="server" ConnectionString="<%$ ConnectionStrings:IVConnectionString %>"
                        SelectCommand="SELECT_RECIBOS_CONCILIACION_POLIZA" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:Parameter Name="Poliza" Type="String" />
                            <asp:Parameter Name="Endoso" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <telerik:RadGrid ID="Grid_2" GridLines="None" runat="server" AllowPaging="True" AllowSorting="True"
                        AllowMultiRowEdit="True" AllowMultiRowSelection="True" Width="900px" AutoGenerateColumns="False"
                        AllowFilteringByColumn="True">
                        <MasterTableView EditMode="InPlace" ClientDataKeyNames="POLIZA, ENDOSO" Name="MasterDetail">
                            <ExpandCollapseColumn Visible="True">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridBoundColumn DataField="POLIZA" HeaderText="Poliza" SortExpression="POLIZA"
                                    UniqueName="POLIZA">
                                    <HeaderStyle Font-Bold="True" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="ENDOSO" HeaderText="Endoso" ReadOnly="True" SortExpression="ENDOSO"
                                    UniqueName="ENDOSO" ItemStyle-Width="100px" AllowFiltering="False">
                                    <HeaderStyle Font-Bold="True" />
                                    <ItemStyle Width="100px"></ItemStyle>
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="AGENTE" HeaderText="Agente" SortExpression="AGENTE"
                                    UniqueName="AGENTE" AllowFiltering="False">
                                    <HeaderStyle Font-Bold="True" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="ASEGURADO" HeaderText="Asegurado" SortExpression="ASEGURADO"
                                    UniqueName="ASEGURADO" ReadOnly="True" AllowFiltering="False">
                                    <HeaderStyle Font-Bold="True" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="MONEDA" HeaderText="Moneda" SortExpression="MONEDA"
                                    UniqueName="MONEDA" ReadOnly="True" AllowFiltering="False">
                                    <HeaderStyle Font-Bold="True" />
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn HeaderText="Detalle" UniqueName="TemplateColumn" 
                                    AllowFiltering="False">
                                    <ItemTemplate>
                                        <asp:Image ID="tooltip" runat="server" ImageUrl="../../Imagenes_LMS/ico_mas_info.gif"/>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                            <ItemStyle Font-Bold="False" Font-Italic="False" Font-Names="Calibri" Font-Overline="False"
                                Font-Size="Small" Font-Strikeout="False" Font-Underline="False" Wrap="True" />
                            <AlternatingItemStyle Font-Bold="False" Font-Italic="False" Font-Names="calibri"
                                Font-Overline="False" Font-Size="Small" Font-Strikeout="False" Font-Underline="False"
                                Wrap="True" />
                            <EditItemStyle BackColor="#DAFCAB" Font-Bold="True" ForeColor="#006600" />
                            <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Names="Calibri" Font-Overline="False"
                                Font-Size="Small" Font-Strikeout="False" Font-Underline="False" Wrap="True" />
                            <DetailTables>
                                <telerik:GridTableView AllowSorting="false" DataSourceID="SqlRecibosDetail" Width="100%"
                                    PageSize="7" AllowFilteringByColumn="False" EditMode="InPlace" DataKeyNames="ID_RECIBO"
                                    ClientDataKeyNames="ID_RECIBO" Name="Detail_Table">
                                    <ParentTableRelation>
                                        <telerik:GridRelationFields DetailKeyField="POLIZA" MasterKeyField="POLIZA" />
                                        <telerik:GridRelationFields DetailKeyField="ENDOSO" MasterKeyField="ENDOSO" />
                                    </ParentTableRelation>
                                    <Columns>
                                        <telerik:GridClientSelectColumn HeaderText="Seleccionar" UniqueName="columnCHec">
                                        </telerik:GridClientSelectColumn>
                                        <telerik:GridBoundColumn DataField="LIQ" HeaderText="Liq." SortExpression="LIQ" UniqueName="LIQ"
                                            ReadOnly="True">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="ID_RECIBO" HeaderText="Recibo" SortExpression="ID_RECIBO"
                                            UniqueName="ID_RECIBO" ReadOnly="True" Visible="False">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="FEC_LIQ" HeaderText="FLiq." SortExpression="FEC_LIQ"
                                            UniqueName="FEC_LIQ" ReadOnly="True" DataFormatString="{0:dd/MM/yy}">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="FECHA_INICIO" HeaderText="Inicio Vig" SortExpression="FECHA_INICIO"
                                            UniqueName="FECHA_INICIO" ReadOnly="True" DataFormatString="{0:dd/MM/yy}">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="SERIE" HeaderText="Serie" DataField="SERIE"
                                            UniqueName="SERIE" ReadOnly="True">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridDropDownColumn DataSourceID="SQLData_Action" EmptyListItemText="Seleccione una opcion..."
                                            EmptyListItemValue="0" EnableEmptyListItem="True" HeaderText="Accion" ListTextField="Action_Desc"
                                            ListValueField="Action_ID" UniqueName="column1">
                                            <HeaderStyle HorizontalAlign="Center" />
                                        </telerik:GridDropDownColumn>
                                        <telerik:GridDropDownColumn DataSourceID="SQLData_Status" EmptyListItemText="Seleccione una opcion..."
                                            EmptyListItemValue="0" EnableEmptyListItem="True" HeaderText="Status" ListTextField="Status_Desc"
                                            ListValueField="Status_ID" UniqueName="column2">
                                            <HeaderStyle HorizontalAlign="Center" />
                                        </telerik:GridDropDownColumn>
                                        <telerik:GridTemplateColumn HeaderText="Autos" UniqueName="TemplateColumn1">
                                            <ItemTemplate>
                                                <asp:Button ID="Button2" runat="server" Text="Detalle" OnClientClick="ConciliacionManual();return false;" />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText="Detalle" UniqueName="DetailColumn">
                                            <ItemTemplate>
                                                <asp:Image ID="tooltip_detail" runat="server" ImageUrl="../../Imagenes_LMS/ico_mas_info.gif" />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="../../Imagenes_LMS/Edit.png"
                                            EditText="Editar" UpdateImageUrl="../../Imagenes_LMS/Update.png" UpdateText="Guardar Cambios"
                                            CancelImageUrl="../../Imagenes_LMS/Cancel.png" CancelText="Cancelar">
                                        </telerik:GridEditCommandColumn>
                                    </Columns>
                                    <EditFormSettings>
                                        <EditColumn UniqueName="EditCommandColumn1">
                                        </EditColumn>
                                    </EditFormSettings>
                                </telerik:GridTableView>
                            </DetailTables>
                        </MasterTableView>
                        <ClientSettings>
                            <Selecting AllowRowSelect="True" />
                            <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" OnGridCreated="GridCreated"
                                OnCommand="GridCommand" />
                        </ClientSettings>
                    </telerik:RadGrid>
                    <br />
                </td>
            </tr>
            <tr align="center">
                <td>
                    <asp:Button ID="Btn_Conciliacion" runat="server" CssClass="Boton" Text="Conciliar Recibos Seleccionados"
                        Width="180px" />    
                    <asp:Button ID="Button1" runat="server" CssClass="Boton" Text="Cancelar" Width="80px"
                        OnClientClick="returnToParent()" />
                </td>
            </tr>
        </table>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="AjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="Grid_2" LoadingPanelID="AjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="Grid_2">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="Grid_2" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" Position="BottomCenter"
            Animation="Fade" RelativeTo="Element" Width="500px" Height="300px" Style="font-size: 18px;
            text-align: center; font-family: Arial;" RenderInPageRoot="true">
        </telerik:RadToolTipManager>
        <telerik:RadToolTipManager ID="RadToolTipManager2" runat="server" 
            Animation="FlyIn" Height="300px" RelativeTo="Element" RenderInPageRoot="True" 
            Width="500px">
        </telerik:RadToolTipManager>
        <telerik:RadAjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server" Skin="Hay" IsSticky="True"
            HorizontalAlign="Center" BackgroundPosition="Top">
        </telerik:RadAjaxLoadingPanel>
    </div>
    <asp:SqlDataSource ID="SqlData_Status" runat="server" ConnectionString="<%$ ConnectionStrings:IVConnectionString %>"
        SelectCommand="SELECT [Status_ID], [Status_Desc] FROM [Status]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlData_Action" runat="server" ConnectionString="<%$ ConnectionStrings:IVConnectionString %>"
        SelectCommand="SELECT [Action_ID], [Action_Desc] FROM [Actions]"></asp:SqlDataSource>
    </form>
</body>
</html>

1 Answer, 1 is accepted

Sort by
0
Alejandro
Top achievements
Rank 1
answered on 10 May 2011, 07:29 PM

Nevermind! I just found out a solution myself, I added a updatedcontrol setting to AjaxManager and worked just fine.

Thanks anyway.

Alex

Asked by
Alejandro
Top achievements
Rank 1
Answers by
Alejandro
Top achievements
Rank 1
Share this question
or