I have a RadGrid column on the second level hierarchy with ToolTips and it works very nice. However, as soon I filter the grid do rows then it look like the ToolTips still referenced somehow to none-filtered grid. Did anybody experience this problem?
Here is how I set the key for the ToolTips object on my second hierarchy level:
| Protected Sub grdLineGrid_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) |
| If e.Item.ItemType = GridItemType.Item OrElse e.Item.ItemType = GridItemType.AlternatingItem Then |
| Dim target As Control = e.Item.FindControl("LinePayment") |
| 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("Inv_Doc_No").ToString() + "|" + currentRow.Row("Pay_Item").ToString() + "|" + currentRow.Row("Inv_Type").ToString(), True) |
| End If |
| End If |
| End If |
| End Sub |
When my OnAjaxUpdate event fires and the rows are filtered then the ToolTipUpdateEventArgs.Value is always a first row on the given page, not the one I move mouse over.
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %> |
| <!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"> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| <Scripts> |
| <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> |
| <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> |
| </Scripts> |
| </telerik:RadScriptManager> |
| |
| <div> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="rdTest"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="btnShowDock" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="btnShowDock"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="rdTest" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <telerik:RadDock ID="rdTest" runat="server" Visible="False" Width="300px"> |
| <ContentTemplate> |
| Test<br /> |
| <asp:Button ID="btnCloseDock" runat="server" OnClick="btnCloseDock_Click" Text="Close" /> |
| </ContentTemplate></telerik:RadDock> |
| </div> |
| <asp:Button ID="btnShowDock" runat="server" OnClick="btnShowDock_Click" Text="Show" /> |
| </form> |
| </body> |
| </html> |
| using System; |
| using System.Web; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| using System.Data; |
| using System.Configuration; |
| using System.Web.Security; |
| using System.Web.UI.WebControls.WebParts; |
| using System.Web.UI.HtmlControls; |
| using Telerik.Web.UI; |
| public partial class Default : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| } |
| protected void btnShowDock_Click(object sender, EventArgs e) |
| { |
| rdTest.Visible = true; |
| btnShowDock.Enabled = false; |
| } |
| protected void btnCloseDock_Click(object sender, EventArgs e) |
| { |
| rdTest.Visible = false; |
| btnShowDock.Enabled = true; |
| } |
| } |
public class AppTemplate : ITemplate
{
private DataTable dtfinalResult = new DataTable();
private ScriptManager _ScriptManager;
public AppTemplate(DataTable dtResult, ScriptManager ScriptManager)
{
dtfinalResult = dtResult.Copy();
_ScriptManager = ScriptManager;
}
public void InstantiateIn(Control container)
{
ImageButton imgexport = new ImageButton();
imgexport.CommandName = "Export";
imgexport.ImageUrl = "/_layouts/images/smallOutlook.gif";
imgexport.Width = new Unit(20);
//imgexport.ID="Export"+
//Exclude from the Ajax
_ScriptManager.RegisterPostBackControl(imgexport);
//imgexport.Attributes.Add("onclick", string.Format("realPostBack(this, \"\"); return false;"));
container.Controls.Add(imgexport);
Literal subject = new Literal();
subject.DataBinding += subject_DataBinding;
container.Controls.Add(subject);
CalendarPlus calendarplus = new CalendarPlus();
}
private void subject_DataBinding(object sender, EventArgs e)
{
Literal subject = (Literal)sender;
IDataItemContainer aptContainer = (IDataItemContainer)subject.BindingContainer;
//Access the appointment object and set its AllowEdit property:
SchedulerAppointmentContainer aptCont = (SchedulerAppointmentContainer)subject.Parent;
Appointment app = aptCont.Appointment;
int APPID = int.Parse(app.ID.ToString());
app.AllowEdit = false;
//app.CssClass = "MyCustomAppointmentStyle";
DataView dvFinalresult = dtfinalResult.DefaultView;
dvFinalresult.RowFilter = "FieldID=" + APPID;
DataTable dtCurrentApp = dvFinalresult.ToTable();
string strSubject = HttpUtility.HtmlEncode((string)DataBinder.Eval(aptContainer.DataItem, "Subject"));
if (dtCurrentApp.Rows.Count > 0)
{
// app.BackColor =System.Drawing.Color.FromName(dtCurrentApp.Rows[0]["color"].ToString());
string scolor = dtCurrentApp.Rows[0]["color"].ToString();
app.CssClass = "rsCategoryYellow";
if (bool.Parse(dtCurrentApp.Rows[0]["IsEditListItem"].ToString()))
subject.Text = "<span id=\"spanID\" style=\"padding-top:4px;padding-left:1px;padding-right:1px;padding-right:3px;margin-top:2px;margin:bottom:2px;height:100%;width:100%\" curDivDate=\"" + dtCurrentApp.Rows[0]["RecurrenceID"].ToString() + "\" title='' onmouseout=\"tooltip.hide();\" onmouseover=\"wsc_showmenu(this); return false\" ><A HREF=\"javascript:void(window.open('" + dtCurrentApp.Rows[0]["URL"].ToString().Trim() + "'))\">" + strSubject + "</a></span>";
else
subject.Text = "<span id=\"spanID\" style=\"padding-top:4px;padding-left:1px;padding-right:1px;padding-right:3px;margin-top:2px;margin:bottom:2px;height:100%;width:100%\" curDivDate=\"" + dtCurrentApp.Rows[0]["RecurrenceID"].ToString() + "\" title='' onmouseout=\"tooltip.hide();\" onmouseover=\"wsc_showmenu(this); return false\" >" + strSubject + "</span>";
}
else
{
subject.Text = strSubject;
}
}
}
Regards
Vairamuhu