I've created a simple page with a RadGrid and a RadToolTipManager on it. What I'm trying to accomplish is very simple. Each row in the grid has an ID and GridImageColumn. When the image is clicked, the ID should display in the ToolTip window. The issue I'm experiencing is after the first ToolTip is displayed, all subsequent attempts to display ToolTips always display the first ToolTip that was displayed, not the ToolTip for the row clicked. So if 3 is clicked, I'd expect to see 3 in the ToolTip. If 2 is clicked, I'd expect to see 2 in the Tooltip and so on.
Here is a video recording displaying the behavior of the issue. If I refresh the page, I can start all over again.
http://screencast.com/t/4zuJtxgGGGUW
rttm.aspx
rttm.aspx.vb
rttmDetails.aspx
rttmDetails.aspx.vb
I'm sure this is a common issue that should have an easy fix. I'm anxiously awaiting your answer.
Thanks,
Rob
Here is a video recording displaying the behavior of the issue. If I refresh the page, I can start all over again.
http://screencast.com/t/
rttm.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="rttm.aspx.vb" Inherits="rttm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"mgrJS"
AsyncPostBackTimeout
=
"600"
>
</
telerik:RadScriptManager
>
<
telerik:RadGrid
runat
=
"server"
ID
=
"rg"
AutoGenerateColumns
=
"False"
Width
=
"620px"
Skin
=
"Web20"
>
<
MasterTableView
HierarchyLoadMode
=
"ServerOnDemand"
Width
=
"620px"
TableLayout
=
"Auto"
DataKeyNames
=
"ID"
>
<
Columns
>
<
telerik:GridBoundColumn
HeaderText
=
"ID"
UniqueName
=
"ID"
DataField
=
"ID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridImageColumn
UniqueName
=
"View"
ImageUrl
=
"App_Themes/BlueBT2009/Images/Inq.gif"
></
telerik:GridImageColumn
>
</
Columns
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
</
telerik:RadGrid
>
<
telerik:RadToolTipManager
ID
=
"RadToolTipManager1"
OffsetY
=
"-1"
HideEvent
=
"Default"
Width
=
"800px"
Height
=
"600px"
runat
=
"server"
EnableShadow
=
"true"
RelativeTo
=
"BrowserWindow"
Position
=
"Center"
OnAjaxUpdate
=
"Load_ToolTip"
Modal
=
"false"
ContentScrolling
=
"Auto"
AutoCloseDelay
=
"0"
ShowEvent
=
"OnClick"
>
</
telerik:RadToolTipManager
>
</
div
>
</
form
>
</
body
>
</
html
>
rttm.aspx.vb
Partial
Class
rttm
Inherits
System.Web.UI.Page
Protected
Sub
rg_ItemDataBound(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridItemEventArgs)
Handles
rg.ItemDataBound
If
e.Item.ItemType = GridItemType.Item
OrElse
e.Item.ItemType = GridItemType.AlternatingItem
Then
Me
.RadToolTipManager1.TargetControls.Add(TryCast(e.Item, GridDataItem)(
"View"
).ClientID, TryCast(e.Item, GridDataItem)(
"ID"
).Text,
True
)
End
If
End
Sub
Protected
Sub
rg_NeedDataSource(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridNeedDataSourceEventArgs)
Handles
rg.NeedDataSource
Dim
dt
As
New
DataTable()
Dim
col
As
New
DataColumn(
"ID"
)
dt.Columns.Add(col)
Dim
row
As
DataRow = dt.NewRow
row(0) = 1
dt.Rows.Add(row)
row = dt.NewRow
row(0) = 2
dt.Rows.Add(row)
row = dt.NewRow
row(0) = 3
dt.Rows.Add(row)
Me
.rg.DataSource = dt
Session(
"rttm"
) = dt
End
Sub
Protected
Sub
Load_ToolTip(
ByVal
sender
As
Object
,
ByVal
args
As
ToolTipUpdateEventArgs)
Dim
invoiceDetails()
As
String
= args.Value.Split(
"_"
)
Dim
toAdd
As
UserControl = LoadUserControl(
"rttmdetails.ascx"
, invoiceDetails)
args.UpdatePanel.ContentTemplateContainer.Controls.Add(toAdd)
args.UpdatePanel.Update()
End
Sub
Private
Function
LoadUserControl(
ByVal
UserControlPath
As
String
,
ByVal
ParamArray
constructorParameters
As
Object
())
As
UserControl
Dim
constParamTypes
As
New
List(Of Type)()
For
Each
constParam
As
Object
In
constructorParameters
constParamTypes.Add(constParam.[
GetType
]())
Next
Dim
ctl
As
UserControl = TryCast(Page.LoadControl(UserControlPath), UserControl)
Dim
constructor
As
System.Reflection.ConstructorInfo = ctl.[
GetType
]().BaseType.GetConstructor(constParamTypes.ToArray())
If
constructor
Is
Nothing
Then
Throw
New
MemberAccessException(
"The requested constructor was not found on : "
& ctl.[
GetType
]().BaseType.ToString())
Else
constructor.Invoke(ctl, constructorParameters)
End
If
Return
ctl
End
Function
End
Class
rttmDetails.aspx
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="rttmDetails.ascx.vb" Inherits="rttmDetails" %>
<
telerik:RadGrid
ID
=
"rg"
runat
=
"server"
AutoGenerateColumns
=
"false"
Skin
=
"Web20"
AllowMultiRowSelection
=
"true"
>
<
MasterTableView
Name
=
"details"
DataKeyNames
=
"ID"
>
<
Columns
>
<
telerik:GridBoundColumn
HeaderText
=
"ID"
UniqueName
=
"ID"
DataField
=
"ID"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
rttmDetails.aspx.vb
Partial
Class
rttmDetails
Inherits
System.Web.UI.UserControl
Private
_id
As
String
Public
Property
Identity()
As
String
Get
Return
(_id)
End
Get
Set
(
ByVal
value
As
String
)
_id = value
End
Set
End
Property
Private
_details
As
DataRow()
ReadOnly
Property
Details()
As
DataRow()
Get
Return
_details
End
Get
End
Property
Public
Sub
New
()
End
Sub
Public
Sub
New
(
ByVal
id
As
String
)
Dim
dt
As
DataTable =
CType
(Session(
"rttm"
), DataTable)
_id = id
_details = dt.
Select
(
"ID="
& id)
End
Sub
Protected
Sub
rgInvoice_NeedDataSource(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridNeedDataSourceEventArgs)
Handles
rg.NeedDataSource
Me
.rg.DataSource = Details
End
Sub
End
Class
I'm sure this is a common issue that should have an easy fix. I'm anxiously awaiting your answer.
Thanks,
Rob