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

Using Tooltip with Grid in a Modal Popup Extender

2 Answers 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 01 Jul 2009, 12:18 PM
I'm trying to get the tool tip manager to work in the grid while its in a modal popup. I've had an enormous amount of success using this with the scheduler control but the grid seems to be different. I followed the example posted to the T except for a few minor exceptions...i'm using a button instead of the way used in the example. The example worked but it displays the tooltip information in the same panel as the grid and causes the panel to stretch. I figured it was because i was using "UpdatePanel5.ContentTemplateContainer.Controls.Add(ctrl)" which causes the previous issue...so i changed the code up from the example to look like the following...all i need to know is how can i pass the parameter from the grid that i need? I have a hidden column called sffacilityid and thats the value i need returned.

                            <telerik:RadGrid ID="RadGrid_Search" runat="server" DataSourceID="DS_Facility_Hardware_Search" 
                                GridLines="None" Width="672px" AllowPaging="True" Height="349px" Style="margin-right: 0px"
                                <HeaderContextMenu EnableTheming="True"
                                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                </HeaderContextMenu> 
                                <PagerStyle PageButtonCount="5" /> 
                                <MasterTableView AutoGenerateColumns="False" DataSourceID="DS_Facility_Hardware_Search"
                                    <RowIndicatorColumn> 
                                        <HeaderStyle Width="20px" /> 
                                    </RowIndicatorColumn> 
                                    <ExpandCollapseColumn> 
                                        <HeaderStyle Width="20px" /> 
                                    </ExpandCollapseColumn> 
                                    <Columns> 
                                        <telerik:GridTemplateColumn> 
                                            <ItemTemplate> 
                                                <asp:ImageButton ID="BtnMoreInfo" runat="server" ImageUrl="~/EDRC/Images/More_Info.png"
                                                </asp:ImageButton> 
                                            </ItemTemplate> 
                                        </telerik:GridTemplateColumn> 
                                        <telerik:GridBoundColumn DataField="FacilityID" DataType="System.Int32" HeaderText="FacilityID" 
                                            ReadOnly="True" SortExpression="FacilityID" UniqueName="FacilityID" Visible="false"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="SFFacilityID" DataType="System.Int32" HeaderText="SFFacilityID" 
                                            SortExpression="SFFacilityID" UniqueName="SFFacilityID" Visible="false"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="FacilityName" HeaderText="FacilityName" SortExpression="FacilityName" 
                                            UniqueName="FacilityName"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="Website" HeaderText="Website" SortExpression="Website" 
                                            UniqueName="Website"
                                        </telerik:GridBoundColumn> 
                                    </Columns> 
                                </MasterTableView> 
                                <FilterMenu EnableTheming="True"
                                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                </FilterMenu> 
                                <%--                                <ClientSettings EnablePostBackOnRowClick="true"
                                 
                                </ClientSettings>--%> 
                                <ClientSettings EnableRowHoverStyle="true"
                                    <Selecting AllowRowSelect="True" /> 
                                </ClientSettings> 
                            </telerik:RadGrid> 
                        </td> 
                    </tr> 
                </table> 
                <div style="z-index: 10"
                    <telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Width="520" Height="380" 
                        OnAjaxUpdate="RadToolTipManager1_AjaxUpdate" AutoTooltipify="true" ShowEvent="OnClick" 
                        ManualClose="true" Modal="true" Position="TopLeft" AutoCloseDelay="0"
                    </telerik:RadToolTipManager> 
                </div> 
            </ContentTemplate> 
        </asp:UpdatePanel> 


 
    Private Sub RadGrid_Search_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid_Search.ItemDataBound 
        If e.Item.ItemType = GridItemType.Item OrElse e.Item.ItemType = GridItemType.AlternatingItem Then 
            Dim target As Control = e.Item.FindControl("BtnMoreInfo"
            If Not [Object].Equals(target, NothingThen 
                If Not [Object].Equals(Me.RadToolTipManager1, NothingThen 
                    Dim currentRow As DataRowView = DirectCast(e.Item.DataItem, DataRowView) 
                    Me.RadToolTipManager1.TargetControls.Add(target.ClientID, currentRow.Row("SFFacilityID").ToString(), True
 
                End If 
            End If 
        End If 
    End Sub 
    Public Sub RadToolTipManager1_AjaxUpdate(ByVal sender As ObjectByVal e As Telerik.Web.UI.ToolTipUpdateEventArgs) Handles RadToolTipManager1.AjaxUpdate 
        Dim ctrl As Control = Page.LoadControl("Controls/TTip.ascx"
 
 
        Dim lblFacilityName As Label = ctrl.Controls(0) 
 
        Dim details As TTip = DirectCast(ctrl, TTip) 
 
        UpdatePanel5.ContentTemplateContainer.Controls.Add(ctrl) 
 
        Dim params(0) As SqlClient.SqlParameter 
        params(0) = New SqlClient.SqlParameter() 
        params(0).Value = 'WHAT DO I CALL HERE? 
        params(0).ParameterName = "@SFFacilityID" 
        Dim rd As SqlClient.SqlDataReader = Data.SqlHelper.ExecuteReader(EDRCConnString, "dbo.FacilityRefinedSelect", params) 
        While rd.Read 
            lblFacilityName.Text = rd.GetString(2) 
        End While 
        rd.Close() 
    End Sub 
 

2 Answers, 1 is accepted

Sort by
0
Ben
Top achievements
Rank 1
answered on 02 Jul 2009, 02:10 PM
So i went back to using the examples way of executing but i figured out how to get the actual tooltip to display above the modal popup panel...still the issue is that whenever i add the control to the update panel...the tooltip disappears and the information displays to the side...not sure whats going on with it here.
http://img7.imageshack.us/img7/5228/maptooltip.png

Link above shows how the data is there but not in tooltip form...



0
Yavor
Telerik team
answered on 06 Jul 2009, 10:50 AM
Hello Ben,

Based on the supplied information, it is hard to determine what is causing the unwanted behavior.
To further trace the issue, you can open a formal support ticket, and send us the problematic code.
We will review it locally, and advise you further.

Greetings,
Yavor
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.
Tags
Grid
Asked by
Ben
Top achievements
Rank 1
Answers by
Ben
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or