Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
615
How to make DataTemplate background transparent?
posted

I have a data template for a tooltip. Inside the data template, I have a border with rounded corners and shadow effect. I want the surround area to be transparent, but somehow the date template background is black. How can I change this to transparent?

Attached is a screen capture of what the tool tip looks like with the black background.

Here's the code for the data template:

<DataTemplate x:Key="tooltipTemplate">
            <Grid Background="Transparent">
                <Border BorderBrush="Gray" BorderThickness="1"  
                    CornerRadius="5" Background="White"
                    IsHitTestVisible="False"  
                    Padding="5"
                    Margin="10">
                <ItemsControl ItemsSource="{Binding}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Visibility="{Binding Series.Visibility}" >
                                <TextBlock Name="title" Text="{Binding Series.Title}" />
                                <TextBlock Text=": " />
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Item.Value}" />
                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text=" Sample Time: " />
                                    <TextBlock Text="{Binding Item.Key}" />
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </Border></Grid>
        </DataTemplate>

Parents
No Data
Reply
  • 30945
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into the appearance that you are trying to achieve and I have created a sample application for you that demonstrates how you can achieve it, by creating a style for ContentControl and assign it to the ToolTipStyle property of the XamDataChart.

     

    If you need any further assistance please do not hesitate to ask.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

    ToolTipStyle.zip
Children