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

  • Home
  • SEARCH
  • 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 131843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:10:09+00:00 2026-05-11T06:10:09+00:00

I have the following DataTemplate in a Listbox <ListBox Grid.Column=1 Grid.Row=2 ItemsSource={Binding People} SelectedItem={Binding

  • 0

I have the following DataTemplate in a Listbox

<ListBox Grid.Column='1' Grid.Row='2' ItemsSource='{Binding People}' SelectedItem='{Binding SelectedPerson}'> <ListBox.ItemTemplate>     <DataTemplate>         <TextBlock OverridesDefaultStyle='True'                Background='{x:Null}'                Margin='0'                Padding='0'                IsHitTestVisible='True'                Text='{Binding TargetNullValue=None}'         />     </DataTemplate> </ListBox.ItemTemplate> 

This works perfectly, displaying ‘None’ in place of any Null (Nothing) values in the bound list. The problem is that I can’t click on the Null values to select them. Selection with the keyboard works perfectly, just not with a mouse. What can I do to make the Null values in the list act just like any other value?

Edit: I should also add that I can change the TextBlock’s background to Red and it displays just like the others so I don’t think it’s a case of having nothing to click on. I’ve also looked at it with Snoop and I don’t see any attributes in the visual tree that are different between a Null item and a normal item.

Edit 2: I should add that People is actually a class representing a database table. It uses the ToString method to display the People objects by default. I get the same effect if I bind to the proper field using the Path option and I thought this would be easier to read.

  • 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. 2026-05-11T06:10:09+00:00Added an answer on May 11, 2026 at 6:10 am

    If you are looking for a solution, maybe you can find what you want here: Why can't I select a null value in a ComboBox?

    Combobox has the same behavior as ListBox.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following WPF ListView: <ListView Grid.Column=2 Grid.Row=1 Margin=0,53,12,6 Name=lvwProperties ItemsSource={Binding Path=SelectedPropertyItems, Mode=TwoWay} Grid.ColumnSpan=2>
I have the following XAML code: <ListBox ItemsSource={Binding Languages}> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <Image Source={Binding
So I have the following DataTemplate for a ListBox.ItemTemplate : <DataTemplate x:Key=Tweet> <Grid> <Grid.ColumnDefinitions>
I have created a listbox control with following DataTemplate <DataTemplate x:Key=lb_Itemtemplate> <DockPanel> <TextBlock Text={Binding}
I have an ItemsControl with the following ItemTemplate: <DataTemplate x:Key=myItemTemplate> <TextBlock Height=??? Text={Binding Path=Description}
I have a user control with the following XAML: <ScrollViewer> <ListBox ItemsSource={Binding Items}> <ListBox.ItemTemplate>
I have the following XAML: <TreeView> <TreeViewItem ItemsSource={Binding} Header=TopMost IsExpanded=True> <TreeViewItem.ItemTemplate> <DataTemplate> <TreeViewItem> <TreeViewItem.Header>
I have the following XAML: <ListBox HorizontalAlignment=Left Margin=0,6,0,10 Name=listBox1 Width=468 ItemsSource={Binding} Grid.ColumnSpan=1> <ItemsControl.ItemTemplate> <DataTemplate>
I have a databound ListBox with an ItemTemplate, following this example : <ListBox ItemsSource={Binding
I have following DataGrid in wpf. <DataGrid AutoGenerateColumns=False Grid.Row=1 Name=adsGrid ItemsSource={Binding Path=Ads} CanUserAddRows=False CanUserDeleteRows=False

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.