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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:21:51+00:00 2026-05-11T05:21:51+00:00

I have a listview that you select a row/item on. This is linked to

  • 0

I have a listview that you select a row/item on. This is linked to a datatrigger that displays an image on the row. The image should only be displayed when the row is selected.

This part works fine, however when you move the focus to something else, such as a textbox, or a messagebox is displayed, the listviewitem loses focus ie the highlight on the row is no longer displayed. The problem is that my image still remains. It should be hidden/collapsed when the listview loses focus… It works fine if you select a different item/row on the listview.

Can anyone help on this please?

<Style x:Key='deleteImageStyle' TargetType='{x:Type Image}'>     <Setter Property='Source' Value='Resources/iconDelete.png' />     <Setter Property='Margin' Value='0,2,5,0' />     <Setter Property='Height' Value='16' />     <Setter Property='Width' Value='16' />     <Setter Property='HorizontalAlignment' Value='Right' />     <Setter Property='VerticalAlignment' Value='Top' />     <Setter Property='Cursor' Value='Hand' />     <Style.Triggers>         <DataTrigger Binding='{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBoxItem}},Path=IsSelected}' Value='True'>             <Setter Property='Visibility' Value='Visible'/>         </DataTrigger>         <DataTrigger Binding='{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBoxItem}},Path=IsSelected}' Value='False'>             <Setter Property='Visibility' Value='Hidden'/>         </DataTrigger>         <Trigger Property='IsEnabled' Value='False'>             <Setter Property='Visibility' Value='Hidden' />         </Trigger>     </Style.Triggers> </Style> 

Regards

TravisPUK

  • 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-11T05:21:52+00:00Added an answer on May 11, 2026 at 5:21 am

    I think you’re confusing IsSelected and IsFocused.

    Experiment with binding your triggers to IsFocused instead of IsSelected to get your desired result.

    If i understand correctly, you only want the image to be visible if both IsSelected and IsFocused are true, otherwise hidden.

    One way to do this is to set default Visibility to Visible, and then add two triggers that set Visibility to Hidden: one trigger for IsSelected = False, and another trigger for IsFocused = False.

    Or the opposite, set default Visibility to Hidden, and use a MultiTrigger with IsSelected = True and IsFocused = True to set it Visibility to Visible

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

Sidebar

Related Questions

I have a ListView. When I select a row I want that only one
I have a ListView that shows a list of names. When you select a
I have a ListView that is a View and this all the properties will
I have a ListView that is populated with 50 items. This is the xml
I have a ListView and would like to remove a row item when the
I have a query that selects rows in a ListView without having a limit.
I have ListView that has the following EditItemTemplate: <EditItemTemplate> <tr style=> <td> <asp:LinkButton ID=UpdateButton
I have ListView that uses a GridView to display several columns of data. Two
I have a ListView that is set up with a MinHeight and a MaxHeight.
I have a ListView that I am populating with items from an ObservableCollection .

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.