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 Object, ByVal 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, Nothing) Then |
If Not [Object].Equals(Me.RadToolTipManager1, Nothing) Then |
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 Object, ByVal 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 |