
function ResizePanelBar()
{
var panelbar =document.getElementById("ctl00_RadPanelbarMain");
panelbar.RadResize();
}
| <script runat="server"> |
| protected override void OnLoad(EventArgs e) |
| { |
| base.OnLoad(e); |
| this.RadToolTipManager1.TargetControls.Add(hylnkProd.ClientID, true); |
| } |
| protected void RadToolTipManager1_AjaxUpdate(object sender, ToolTipUpdateEventArgs e) |
| { |
| e.UpdatePanel.ContentTemplateContainer.Controls.Add(pnlUpdate); |
| pnlUpdate.Visible = true; |
| } |
| </script> |
| <asp:ScriptManager id="ScriptManager" runat="server"/> |
| <telerik:radtooltipmanager id="RadToolTipManager1" |
| runat="server" |
| Position="BottomRight" |
| ShowEvent="OnClick" |
| ManualClose="true" |
| Sticky="true" |
| width="500px" |
| height="100px" |
| Skin="Web20" |
| OnAjaxUpdate="RadToolTipManager1_AjaxUpdate"> |
| </telerik:radtooltipmanager> |
| <TABLE id="tblProd" cellSpacing="1" cellPadding="1" border="0" runat="server" width="700"> |
| <TR> |
| <TD class="Normal"> |
| <HR width="100%" SIZE="1"> |
| </TD> |
| </TR> |
| <tr> |
| <td class="Normal" style="width: 161px"> |
| <asp:hyperlink id="hylnkProd" runat="server" navigateurl="#" style="text-decoration:none;" Text="Test"></asp:hyperlink> |
| </td> |
| </tr> |
| </TABLE> |
| <asp:Panel ID="pnlUpdate" runat="server" Visible="false"> |
| <table cellpadding="0" cellspacing="10" border="0" class="Normal"> |
| <tr> |
| <td colspan="2"> |
| <asp:Label ID="lblProductTitle" runat="server" Text="This is a test"></asp:Label> |
| </td> |
| </tr> |
| </table> |
| </asp:Panel> |
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<link rel="stylesheet" href="Skins/CustomSkin/ToolTip.CustomSkin.css" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<br />
<br />
<br />
<radG:RadGrid ID="RGSample" AllowPaging="true" PageSize="15" EnableAJAX="false" AutoGenerateColumns="false"
runat="server" Height="50%" DataSourceID="AccessDataSource1" OnItemDataBound="RGSample_ItemDataBound"
Skin="Grey" SkinsPath="RadControls/Grid/Skins" CssClass="RadGrid" CellPadding="2"
CellSpacing="2" OnDataBinding="RGSample_DataBinding" OnSortCommand="RGSample_SortCommand" OnDataBound="RGSample_DataBound1" >
<PagerStyle Mode="NumericPages" />
<MasterTableView AllowCustomPaging="False" AllowPaging="True" AllowSorting="True"
GridLines="both" HorizontalAlign="NotSet" PageSize="10" CellPadding="2" CellSpacing="2"
Width="100%" BorderColor="black">
<Columns>
<radG:GridHyperLinkColumn DataTextField="CustomerID" HeaderText="CustomerID" SortExpression="CustomerID"
UniqueName="CustomerID">
</radG:GridHyperLinkColumn>
<radG:GridTemplateColumn HeaderText="ContactName" SortExpression="ContactName" UniqueName="ContactName">
<ItemTemplate>
<asp:Label ID="lblContactName" runat="server" Text='<%#Eval("ContactName") %>'></asp:Label>
</ItemTemplate>
</radG:GridTemplateColumn>
<radG:GridBoundColumn DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName"
UniqueName="CompanyName">
</radG:GridBoundColumn>
<radG:GridTemplateColumn UniqueName="Click">
<ItemTemplate>
<asp:ImageButton ID="imgBtn" runat="server" ImageUrl="~/24find.gif" CommandName="Find" />
</ItemTemplate>
</radG:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings>
<Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" />
</ClientSettings>
</radG:RadGrid>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb"
SelectCommand="SELECT top 10 [CustomerID], [CompanyName], [ContactName] FROM [Customers]">
</asp:AccessDataSource>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<telerik:RadToolTipManager ID="RTMCustomer" runat="server" RelativeTo="Mouse" Position="MiddleRight"
BorderStyle="None" Width="250px" Height="300px" Animation="None" Sticky="true"
ManualClose="true" Skin="CustomSkin" EnableEmbeddedSkins="false" OnAjaxUpdate="RTMCustomer_OnAjaxUpdate"
ShowCallout="true" EnableViewState="false">
</telerik:RadToolTipManager>
</form>
</body>
</html>
Here is my .CS file
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
public partial class _Default : System.Web.UI.Page
{
protected Dictionary<string, string> controlcollection = new Dictionary<string, string>();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void RGSample_ItemDataBound(object sender, Telerik.WebControls.GridItemEventArgs e)
{
if (e.Item.ItemType == Telerik.WebControls.GridItemType.Item || e.Item.ItemType == Telerik.WebControls.GridItemType.AlternatingItem)
{
System.Web.UI.WebControls.Label lblContactName = (System.Web.UI.WebControls.Label)e.Item.FindControl("lblContactName");
if (lblContactName != null)
{
DataRowView currentRow = (DataRowView)e.Item.DataItem;
if (!controlcollection.ContainsKey(lblContactName.ClientID))
controlcollection.Add(lblContactName.ClientID, currentRow.Row["CustomerID"].ToString());
}
//if (!Page.IsPostBack)
//{
// lblContactName.ID = currentRow.Row["CustomerID"].ToString();
//}
if (this.RTMCustomer != null)
this.RTMCustomer.TargetControls.Add(lblContactName.ClientID, true);
}
}
protected void RTMCustomer_OnAjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e)
{
Dictionary<string, string> controls = (Dictionary <string, string>)Session["controlcollection"];
int index = e.TargetControlID.LastIndexOf("_");
//string elementID = e.TargetControlID.Substring(index + 1);
string elementID = controls[e.TargetControlID];
this.UpdateToolTip(elementID, e.UpdatePanel);
}
private void UpdateToolTip(string elementID, UpdatePanel panel)
{
try
{
Control ctrlPopup = Page.LoadControl("Popup.ascx");
panel.ContentTemplateContainer.Controls.Add(ctrlPopup);
PopUp popUp = (PopUp)ctrlPopup;
popUp.CustomerID = elementID;
}
catch (Exception)
{
}
}
protected void RGSample_DataBinding(object sender, EventArgs e)
{
RTMCustomer.TargetControls.Clear();
}
protected void RGSample_SortCommand(object source, Telerik.WebControls.GridSortCommandEventArgs e)
{
RTMCustomer.TargetControls.Clear();
}
protected void RGSample_DataBound1(object sender, EventArgs e)
{
Session.Add("controlcollection", controlcollection);
}
}
Looking forward for your support
Thanks
PRASANNA