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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:22:39+00:00 2026-05-25T19:22:39+00:00

The setup: ListView with GridView that is initially hidden when the window is loaded,

  • 0

The setup:

ListView with GridView that is initially hidden when the window is loaded, and then made visible upon a certain user action.

The aim:

Be able to set relative width of GridView’s columns.

The problem:

What I need can be achieved either by using a converter on the width (something similar to the answer here), or by adding a Behavior on the ListView (see this solution).
The both approaches seem to be valid – but only for the controls that are rendered from the early beginning.
In my case, the ActualWidth is always 0 when the calculations are made, and these calculations are not repeated when the ListView is made visible.

So, I guess, the real question here is how to get the columns’ Width to be re-evaluated when ListView’s ActualWidth gets greater than 0.

The solution would preferably be at the XAML level, without involving the code-behind – but that will do too, if that’s the only alternative 😉

Any suggestions?

P.S. Following Chris’s question below, here’s a clarification on how the ListView is hidden/shown: it’s a child of another container control, hosted in a Grid column, and the width of that column is manipulated by a trigger.

<ColumnDefinition>
    <ColumnDefinition.Style>
        <Style>
            <Setter Property="ColumnDefinition.Width" Value="4*"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=OpenItems.Count}" Value="0">
                    <Setter Property="ColumnDefinition.Width" Value="0"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </ColumnDefinition.Style>
</ColumnDefinition>

I tried to apply a similar trigger to the ListView’s container itself (to manipulate its Visibility between Collapsed and Visible) instead, but the problem with that is that the Column doesn’t shrink from its original 4* width, so I see the (empty) control when it’s supposed to be hidden.

  • 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-25T19:22:40+00:00Added an answer on May 25, 2026 at 7:22 pm

    How are you hiding/showing the ListView? The question seems to imply that you are doing so by setting the Width property to 0 (or non-zero to show it). Instead, you should try using the Visibility property (set to “Collapsed” to hide, or “Visible” to show). This should cause the column’s width to be re-evaluated.

    UPDATE:

    Based on your updated question, I’d suggest checking out this solution: http://www.codeproject.com/KB/grid/ListView_layout_manager.aspx

    I got it from here FWIW: WPF : Extend last column of ListView's GridView

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

Sidebar

Related Questions

I have a ListView setup in details mode that looks like this: When the
Setup I have a website that draws RSS feeds and displays them on the
In my listview I show thumbnails of small images in a certain folder. I
I have a ListView with a custom Adapter that extends ArrayAdapter. It's a ArrayAdapter
My Listview is setup in the details view with the following column headers: Image
I have a simple listview and listadapter setup as follows: listAdapter = new ArrayAdapter<MyDomainObject>(this,
I have a listview that needs to be multiple choice (i.e each list item
Setup Have you ever had the experience of going into a piece of code
Setup is following: Drupal project, one svn repo with trunk/qa/production-ready branches, vhosts for every
Setup is SQL2005 SP2 with Reporting Services installed local on Win2003 64bit. When users

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.