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 8786377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:36:31+00:00 2026-06-13T21:36:31+00:00

Silverlight5 I am trying to get the TextBlock to be visible when there is

  • 0

Silverlight5

I am trying to get the TextBlock to be visible when there is no data in the DataGrid.

What to bind to in the DataGrid?

When I bind to Visibility as below, it always returns true even when there is no data in the grid.

    <TextBlock Grid.Row="4" HorizontalAlignment="Center" Text="No User Accounts found." 
Visibility="{Binding ElementName=AccountGridT32, Path=Visibility, 
Converter={StaticResource NegateVisibilityConverter}}" />

    <Grid Grid.Row="5">
    <sdk:DataGrid x:Name="AccountGridT32" 
ItemsSource="{Binding Data, ElementName=AccountsDataSourceT32}" Grid.Column="0" Grid.Row="1" 
    ScrollViewer.HorizontalScrollBarVisibility="Auto" />
    </Grid>
  • 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-06-13T21:36:32+00:00Added an answer on June 13, 2026 at 9:36 pm

    What i do is bind the visibility of the texblock to the item count of the listbox/grid…

    <TextBlock Grid.Row="4" HorizontalAlignment="Center" Text="No User Accounts found." 
    Visibility="{Binding ItemsSource.Count, ElementName=AccountGridT32, Converter={StaticResource listCountToVis}, ConverterParameter=true}" />
    

    My converter:

    public class ListCountToVisibilityConverter : IValueConverter
        {
            #region IValueConverter Members
    
            public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                if (value == null || !(value is int))
                    return Visibility.Collapsed;
    
                bool booInvert = false;
                if (parameter is string) bool.TryParse((string)parameter, out booInvert);
    
                if (booInvert) return ((int)value) <= 0 ? Visibility.Visible : Visibility.Collapsed;
                else return ((int)value) > 0 ? Visibility.Visible : Visibility.Collapsed;
    
    
            }
    
            public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                return null;
            }
    
            #endregion
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a heck of a time trying to get a silverlight datagrid to
I'm using Telerik's controls for Silverlight and I'm trying to get my data bound
I've been trying to use the code below to get the list of AD
Im trying to get started with silverlight for wp7 and I understand its Silverlight
I am trying to get my silverlight application running with elevated privileges in browser.
i'm trying to get started with silverlight 2. i have a weird bug. every
I am trying to get started doing some Silverlight development. I am interested in
I am trying to get out of browser support working for my Silverlight application
I'm still trying to get my feet on the ground with Silverlight and RIA
i'm trying to create a silverlight wepart to get the listItems from a SharePointList.

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.