Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6853203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:29:02+00:00 2026-05-27T01:29:02+00:00

I am working on a calendar program, which consists mainly of a WPF DataGrid

  • 0

I am working on a calendar program, which consists mainly of a WPF DataGrid. As there is not always enough space to display all the entries of a day (which is a DataGridCell), a tooltip with all the entries of the day shell appear at mouse over. This works so far with the code snippet shown below. And now the (little) problem: If there are no entries for a day, no tooltip shell pop up. With the code below an empty tooltip pops up.

<DataGridTemplateColumn x:Name="Entry" 
                        IsReadOnly="True">
  <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
      <Grid>
        <TextBlock Text="{Binding EntryText}"
                   Foreground="{Binding EntryForeground}"
                   FontWeight="{Binding EntryFontWeight}">
        </TextBlock>
        <TextBlock Text="{Binding RightAlignedText}"
                   Foreground="Gray"    
                   Background="Transparent">
          <TextBlock.ToolTip>
            <TextBlock Text="{Binding AllEntriesText}"/>
          </TextBlock.ToolTip>
        </TextBlock>
      </Grid>
    </DataTemplate>
  </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

The Databinding is made via

myCalDataGrid.Itemssource = _listOfDays; 

in code behind, where a ‘Day’ is the view model for a single calendar row.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:29:03+00:00Added an answer on May 27, 2026 at 1:29 am

    As H.B. suggested bind directly to the ToolTip property instead of using TextBlock and in case AllEntriesText is empty string you can apply a trigger on your TextBlock to disable your tooltip by setting the property ToolTipService.IsEnabled like this –

    <TextBlock Text="{Binding RightAlignedText}"
               Foreground="Gray"    
               Background="Transparent"
               ToolTip="{Binding AllEntriesText}">
       <TextBlock.Style>
          <Style TargetType="TextBlock">
             <Style.Triggers>
                <Trigger Property="ToolTip"
                         Value="{x:Static system:String.Empty}">
                   <Setter Property="ToolTipService.IsEnabled" Value="False" />
                </Trigger>
             </Style.Triggers>
           </Style>
        </TextBlock.Style>
    </TextBlock>
    

    Make sure to add namespace system in your xaml –

    xmlns:system="clr-namespace:System;assembly=mscorlib"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my app which create an calendar using buttons..its working fine in all resolution
Working with python interactively, it's sometimes necessary to display a result which is some
I have calendar that is working fine. Here is the function that display the
I am working on simple application which creates google calendar (under it's own account).
I am currently working on a Google Calendar Sync Feature which is supposed to
i have written this code and its not working...... indate = 13/1/2011 Calendar cd1
I am working on application in which i want to show a calendar in
I am working on a calendar application that outputs a list of events in
I'm working on a calendar page that allows a user to click on a
I managed to get the YUI calendar widget working fine. But When it displays

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.