Hiding ToolTip on GridViewColumn

2 posts, 0 answers
  1. YK
    YK avatar
    6 posts
    Member since:
    Nov 2011

    Posted 17 Nov 2011 Link to this post

    Hi,
    I have a problem hiding tooltip on the cell, so I thought that maybe someone already had this problem and could help. I generate the datagrid dynamically in the code behind(I get binding strings from a service call for the columns) and some of the columns have tooltips. I use the ToolTipTemplate property on the column to assign the tooltip. I generate the tooltips for the columns on the fly by calling a method which returns the following

    return

     

     

    (DataTemplate)XamlReader.Load(@"<DataTemplate xmlns=""http://schemas.microsoft.com/client/2007"">

     

    <TextBlock Text=""{Binding "

     

     

    + toolTip + @"}"" TextWrapping=""Wrap"" MaxWidth=""200""/>

     

    </DataTemplate>"

     

     

    );
    Everything works fine till here. But the problem comes when there is no value present and an empty tooltip is displayed for the cells (in the column) which doesnt have a string value to show.
    How can I hide this empty tooltip and show the tooltip when there is value to show?
    Thanks in advance
    YK

     

  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 18 Nov 2011 Link to this post

    Hi,

    Please take a look at the following forum thread for a reference.
     

    All the best,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top