This is a migrated thread and some comments may be shown as answers.

GridView conditional ToolTips showing artefacts

1 Answer 111 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Aggie
Top achievements
Rank 1
Aggie asked on 29 Sep 2011, 05:17 AM
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>

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 29 Sep 2011, 07:18 AM
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 >>

Tags
GridView
Asked by
Aggie
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or