Hi,
In my datagrid each cell of first column have tooltip which is set in cellcontrolattached event. Naw problem is when i make mouse action fast on grid some times tooltip seen any where on grid and it will show untill you refresh the page. Then i set show duration 5 sec to tooltip then it will dissappear in 5 sec(if it is anywhere on screen).
at the same time if tooltip diaply any where on screen and within 5 sec i move my mouse on first column then new tooltip is seen and first tool tip remain on screen So it is possible to remove tooltip forcefully or avy other way to solve this problem ...
Pls reply .......
So CellControlAttached is probably not a good place to handle this. As the controls you're attaching it to will be recycled and reused by other cells.
We actually have a tooltip feature that you can take advantage of:
http://help.infragistics.com/NetAdvantage/Silverlight/2010.3/CLR4.0/?page=xamGrid_ToolTips.html
-SteveZ
hi,
We have created Header Template which contain Image from code behind and we given tooltip to image. we set tooltip binding to image by using Ivalueconverter(return cusmized tooltip from Ivalueconverter ) . As per your suggestion how i do this.Pls Reply...
Thanks
The Tooltip feature is built to handle data cells not header cells.
So to add a tooltip, you'll just have to manually add one in your HeaderTemplate.
As for binding to it with a value converter it should work as normal, however the Source of your binding should be a StaticResource.
yes i get idea for HeaderTemplate.But i set tootip for each cell of first column.(as i ask initially) that problem is not solved yet. In that I created one usercontrol for tooltip details and it is set in cellControlattach event to Tooltip.
when i make mouse action fast on grid some times tooltip seen any where on grid and it will show untill you refresh the page. Then i set show duration 5 sec to tooltip then it will dissappear in 5 sec(if it is anywhere on screen).
at the same time if tooltip diaply any where on screen and within 5 sec i move my mouse on first column then new tooltip is seen and first tool tip remain on screen So it is possible to remove tooltip forcefully or any other way to solve this problem
I have tried to fire mouse enter ,leave . . event from tooltip detailUserControl to but it is not fired. and also i tried fire event of Tooltip from cellcontrolattached event they are also not fired.
So is there any solution to atleast hide tooltip if it is display somewhere on screen insted first column.Please reply..
Do you think you could provide a simple sample showing your specific scenario?
My problem is as i said i have tooltip to my first column only.
i give show duration 1 sec to ToolTip . Naw when i press mouseleft button and within 1 sec i drag mouse on second column (or instead first column) and release the mouse button then Tooltip is seen where i release the mouse button. So pls tell me any solution....
Do you use the Silverlight ToolTipService class to attach the tooltips in the CellControlAttached event handler or some other custom tooltip service (like http://tooltipservice.codeplex.com/)?
Could you provide a sample application reproducing the issue so we can investigate it and try to help you?
Regards,
I've tried to run the code that you pasted but I was not able to. You are using a custom ToolTip. The standard Silverlight ToolTip class (http://msdn.microsoft.com/en-us/library/system.windows.controls.tooltip_properties(v=VS.95).aspx) does not have InitialDelay and ShowDuration.
Could you provide a simplified working sample that reproduces the issue?
Yes i have used Silverlight ToolTip,StooltipService class
pls see the following code
CellControl ctrl = (CellControl)e.Cell.Control;
Image imgNotes = null;
if (((ctrl != null && ctrl.Content != null) && (iSelectedSubFormID != 51)
&& (iSelectedSubFormID != 11) && (iSelectedSubFormID != 56) && app.objCompany.ListNotes != null) || ((iSelectedSubFormID == 63) && (iSelectedSubFormID == 51))) {
imgNotes = ((Grid)ctrl.Content).FindName("imgNotes") as Image;
if ((!objComMethods.ExcludedDisplayListColumns(e.Cell.Column.HeaderText.Trim()) || e.Cell.Column.HeaderText.Trim() == "Description")
&& tbItem.ElementSpecRefTaxonomy != null && tbItem.ElementSpecRefTaxonomy.Length > 0
&& e.Cell.Value != null && e.Cell.Value.ToString().Length > 0) {
if (imgNotes != null) {
string sNotes = "";
if (e.Cell.Column.HeaderText.Trim() == "Description") {
var objResultRow = (from p in app.objCompany.ListNotes
where p.PeriodContextrefID == null
&& p.SpecElementID == tbItem.SpecElementId
&& p.SubformId == app.objCompany.ObjectBizElements.GetSubFormID(tbItem.ElementSpecRefTaxonomy)
select p).ToList();
if (objResultRow.Count() > 0)
{
sNotes = "Note [" + Convert.ToDateTime(objResultRow[0].NoteAddedOn).ToShortDateString() + "]:- " + objResultRow[0].ToolTip;
}
if (e.Cell.Column.HeaderText.Trim() != "Description")
var objResultCell = (from p in app.objCompany.ListNotes
where p.PeriodContextrefID == app.objCompany.GetPeriodID(e.Cell.Column.HeaderText.Trim())
if (objResultCell.Count() > 0)
sNotes = "Note [" + Convert.ToDateTime(objResultCell[0].NoteAddedOn).ToShortDateString() + "]:- " + objResultCell[0].ToolTip;
if (sNotes.Trim().Length > 0)
imgNotes.Visibility = Visibility.Visible;
ToolTip ttNotes = new ToolTip
InitialDelay = 0,
ShowDuration = 7000
};
TextBox txtNotes = new TextBox();
txtNotes.Style = app.Resources["NotesTooltipStyle"] as Style;
txtNotes.Text = sNotes;
if (txtNotes.Text.Length > 0)
ttNotes.Content = txtNotes;
ttNotes.Visibility = Visibility.Visible;
ToolTipService.SetToolTip(imgNotes, ttNotes);
else
imgNotes.Visibility = Visibility.Collapsed;
if (imgNotes != null)
catch (Exception)
throw;