GridView conditional ToolTips showing artefacts

2 posts, 0 answers
  1. Aggie
    Aggie avatar
    1 posts
    Member since:
    Mar 2011

    Posted 29 Sep 2011 Link to this post

    Hello,

    I have a requirement to show tooltips for cells in a grid view, however not all cells in a given column require a tooltip. I have achieved this by using the code from your samples. However, for the rows that do not need the tooltip there is always a little box showing, which looks like a bug to me. Can you please help in getting rid of this artefact?

    I have tried the below code and also commenting out the data template rule for ToolTipTemplate_Collapsed but both result in the same problem - screenshot attached.

    My code from xaml:
    <Grid.Resources>
        <DataTemplate x:Key="ToolTipTemplate_Visible">
            <TextBlock Text="{Binding Reason,Mode=OneWay}"/>
        </DataTemplate>
        <DataTemplate x:Key="ToolTipTemplate_Collapsed">
            <TextBlock Visibility="Collapsed" Height="0" Width="0"/>
        </DataTemplate>
     
        <ViewModels:ToolTipVisibilityConverter x:Key="converter" />
        <Selectors:ConditionalDataTemplateSelector x:Key="selector" ConditionConverter="{StaticResource converter}">
            <Selectors:ConditionalDataTemplateSelector.Rules>
                <Selectors:ConditionalDataTemplateRule DataTemplate="{StaticResource ToolTipTemplate_Visible}">
                    <Selectors:ConditionalDataTemplateRule.Value>
                        <sys:Boolean>True</sys:Boolean>
                    </Selectors:ConditionalDataTemplateRule.Value>
                </Selectors:ConditionalDataTemplateRule>
                <Selectors:ConditionalDataTemplateRule DataTemplate="{StaticResource ToolTipTemplate_Collapsed}">
                    <Selectors:ConditionalDataTemplateRule.Value>
                        <sys:Boolean>False</sys:Boolean>
                    </Selectors:ConditionalDataTemplateRule.Value>
                </Selectors:ConditionalDataTemplateRule>
            </Selectors:ConditionalDataTemplateSelector.Rules>
        </Selectors:ConditionalDataTemplateSelector>
    </Grid.Resources>
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 29 Sep 2011 Link to this post

    Hi Aggie,

    Please take a look at this forum thread for a reference.
     

    Kind regards,
    Maya
    the Telerik team

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

Back to Top