Hi,
I received a request from a customer about showing tooltips on cells when the cell contents exceeds the size of the cell.
Our windows forms client has that functionality using ms listview control. (See attached image.)
In my Silverlight application I display a thumbnail of the document when hoovering over the first column, so I thought I could set the tooltip in the same section: GridViewCell.MouseEnter.
In the MouseEnter handler I measure the width of the column and a temporary Textbox with the contents of the column. If it exceeded I set the tooltip. (Expecting some problems with datetime columns etc.)
And the result: No tooltip gets displayed, is there a way to accomplish this?
Kind regards,
Ronald
I received a request from a customer about showing tooltips on cells when the cell contents exceeds the size of the cell.
Our windows forms client has that functionality using ms listview control. (See attached image.)
In my Silverlight application I display a thumbnail of the document when hoovering over the first column, so I thought I could set the tooltip in the same section: GridViewCell.MouseEnter.
In the MouseEnter handler I measure the width of the column and a temporary Textbox with the contents of the column. If it exceeded I set the tooltip. (Expecting some problems with datetime columns etc.)
var tb =
new
TextBlock { Text = cell.Value.ToString() };
if
(tb.ActualWidth > cell.ActualWidth)
{
cell.SetValue(ToolTipService.ToolTipProperty, tb.Text);
return
;
}
cell.SetValue(ToolTipService.ToolTipProperty,
null
);
And the result: No tooltip gets displayed, is there a way to accomplish this?
Kind regards,
Ronald