Hi,
I would like to display dynamically ToolTip on each RadDataGrid Cells.
To do that, i use the RadToolTipManager like this:
( My Grid are populated with Ajax method after selection some criterias. )
My Telerik:DataGrid componement are wrapped in "asp:UpdatePanel"
On this DataGrid, i'm setting an "onitemdatabound" attribute.
Here, the squeleton of my ASPX code:
The ItemDataBound is correctly fired when i populating column on my DataGrid (with RadAjaxManager telerik componment)
In this method, for each DataGrid Cells iterated, i add there clientId property to the TargetControl Collection on my RadToolTipManager like this:
To test my program, i'm setting a BreakPoint to my "JMRadToolTipManager_OnAjaxUpdate" method which is theorically fired when i mouve my mouse over each Cells of my DataGrid.
This method is never fired!!!!!!!!!
Here , the contents of this method:
Note: I use Fake control setting in my code like mentioned in many post of you forums to workAround the problem of TargetCollection Empty which fired the OnAjaxUpdate method on each componement of my ASPX Page.
Could you help me please.
Thank
I would like to display dynamically ToolTip on each RadDataGrid Cells.
To do that, i use the RadToolTipManager like this:
<asp:Label id="fakeControl" runat="server"></asp:Label> |
<telerik:RadToolTipManager ID="JMRadToolTipManager" runat="server" |
Position="BottomRight" Animation="Fade" AutoTooltipfy="False" Skin="Default" |
OnAjaxUpdate="JMRadToolTipManager_OnAjaxUpdate"> |
<TargetControls> |
<telerik:ToolTipTargetControl IsClientID="true" TargetControlID="fakeControl"/> |
</TargetControls> |
</telerik:RadToolTipManager> |
( My Grid are populated with Ajax method after selection some criterias. )
My Telerik:DataGrid componement are wrapped in "asp:UpdatePanel"
On this DataGrid, i'm setting an "onitemdatabound" attribute.
Here, the squeleton of my ASPX code:
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" > |
<ContentTemplate> |
<asp:Label id="fakeControl" runat="server"></asp:Label> |
<telerik:RadToolTipManager>...</telerik:RadToolTipManager> |
<telerik:RadGrid ID="JMRadGridResultstatGlobal" runat="server" |
meta:resourcekey="JMRadGridResultstatGlobalResource1" |
onitemdatabound="JMRadGridResultstatGlobal_ItemDataBound"> |
<Columns> |
<telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" |
DataField="PartyGroupName" Groupable="False" HeaderText="POLES" |
UniqueName="PartyGroupName" meta:resourcekey="GridBoundColumnResource5"> |
<HeaderStyle Width="200px" /> |
<ItemStyle Width="200px" HorizontalAlign="Left" VerticalAlign="Middle" /> |
</telerik:GridBoundColumn> |
<telerik:GridTemplateColumn AllowFiltering="False" DataType="System.Int64" |
DataField="OnTimeCount" Groupable="False" HeaderText="Nbr OK" |
UniqueName="OnTimeCount" > |
<ItemTemplate> |
<asp:Label ID="lblOnTimeCount" runat="server" Text='<%#Eval("OnTimeCount") %>' meta:resourcekey="GridBoundColumnResource6"> |
</asp:Label> |
</ItemTemplate> |
<HeaderStyle Width="30px" /> |
<ItemStyle Width="30px" HorizontalAlign="Center" VerticalAlign="Middle" /> |
... |
</columns> |
.... |
</telerik:RadGrid> |
</ContentTemplate> |
</asp:UpdatePanel> |
</telerik:RadGrid> |
The ItemDataBound is correctly fired when i populating column on my DataGrid (with RadAjaxManager telerik componment)
In this method, for each DataGrid Cells iterated, i add there clientId property to the TargetControl Collection on my RadToolTipManager like this:
protected void JMRadGridResultstatGlobal_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
string clientID = string.Empty; |
if ((e.Item.ItemType == GridItemType.AlternatingItem) || (e.Item.ItemType == GridItemType.Item)) |
{ |
foreach (GridColumn column in e.Item.OwnerTableView.RenderColumns) |
{ |
string monitoringName = e.Item.Cells[2].Text; |
string slotType = string.Empty; |
if (column is GridTemplateColumn) |
{ |
switch (column.OrderIndex) |
{ |
case 3: |
clientID = e.Item.Cells[column.OrderIndex].FindControl("lblLateCount").ClientID; |
//((Label)e.Item.Cells[column.OrderIndex].FindControl("lblLateCount")).ToolTip = "ClientId:" + e.Item.Cells[column.OrderIndex].FindControl("lblLateCount").ClientID + ""; |
slotType = ResultContainer.SlotTypeList.NO_EXPORT.ToString(); |
break; |
case 4: |
clientID = e.Item.Cells[column.OrderIndex].FindControl("lblOnTimeCount").ClientID; |
//((Label)e.Item.Cells[column.OrderIndex].FindControl("lblOnTimeCount")).ToolTip = "ClientId:" + e.Item.Cells[column.OrderIndex].FindControl("lblOnTimeCount").ClientID + ""; |
slotType = ResultContainer.SlotTypeList.AHEAD.ToString(); |
break; |
case 5: |
clientID = e.Item.Cells[column.OrderIndex].FindControl("lblAheadCount").ClientID; |
//((Label)e.Item.Cells[column.OrderIndex].FindControl("lblAheadCount")).ToolTip = "ClientId:" + e.Item.Cells[column.OrderIndex].FindControl("lblAheadCount").ClientID + ""; |
slotType = ResultContainer.SlotTypeList.LATE.ToString(); |
break; |
case 6: |
clientID = e.Item.Cells[column.OrderIndex].FindControl("lblNoExportCount").ClientID; |
//((Label)e.Item.Cells[column.OrderIndex].FindControl("lblNoExportCount")).ToolTip = "ClientId:" + e.Item.Cells[column.OrderIndex].FindControl("lblNoExportCount").ClientID + ""; |
slotType = ResultContainer.SlotTypeList.ON_TIME.ToString(); |
break; |
default: |
break; |
} |
JMRadToolTipManager.TargetControls.Add(clientID, monitoringName + "|" + slotType, true); |
} |
} |
} |
JMRadToolTipManager.DataBind(); |
} |
To test my program, i'm setting a BreakPoint to my "JMRadToolTipManager_OnAjaxUpdate" method which is theorically fired when i mouve my mouse over each Cells of my DataGrid.
This method is never fired!!!!!!!!!
Here , the contents of this method:
protected void JMRadToolTipManager_OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args) |
{ |
Control ctrl = Page.LoadControl("CustomersList.ascx"); |
args.UpdatePanel.ContentTemplateContainer.Controls.Add(ctrl); |
CustomersList details = (CustomersList)ctrl; |
if ((args.Value != null) && (args.Value.Length > 1)) |
{ |
details.MonitoringName = (args.Value.Split('|'))[0]; |
details.Slot = (args.Value.Split('|'))[1]; |
} |
} |
Note: I use Fake control setting in my code like mentioned in many post of you forums to workAround the problem of TargetCollection Empty which fired the OnAjaxUpdate method on each componement of my ASPX Page.
Could you help me please.
Thank