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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:45:04+00:00 2026-06-03T00:45:04+00:00

I am using ListView control instead of DataGrid in my WPF application. I want

  • 0

I am using ListView control instead of DataGrid in my WPF application. I want to give * width to my ListView.GridViewColumn, but whenever I am providing * width to ListView.GridViewColumn, it gives me a compile time error. Kindly suggest me how can I provide * width to ListView.GridViewColumn, so that ListView.GridViewColumn can automatically fill extra space when I maximize screen.

Any help on this will highly appreciated. Thanks

  • 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-03T00:45:06+00:00Added an answer on June 3, 2026 at 12:45 am

    Please try that solution:

    <ListView>
        <ListView.View>
            <GridView>
                <GridViewColumn Header="column1" x:Name="col1"/>
                <!--Column that shall resize: Width is set to the Actual Width of the helper field defined below-->
                <GridViewColumn Header="column2" 
                                Width="{Binding ElementName=helperField, Path=ActualWidth}"/>
            </GridView>
        </ListView.View>
        Test Text
    </ListView>
    
    <!--This is the hidden helper Grid which does the resizing -->
    <Grid Visibility="Hidden">
        <Grid.ColumnDefinitions>
            <!--Width is bound to width of the first GridViewColumn -->
            <ColumnDefinition Width="{Binding ElementName=col1, Path=ActualWidth}"/>
            <!--Width is set to "Fill"-->
            <ColumnDefinition Width="*"/>
            <!--Correction Width-->
            <ColumnDefinition Width="10"/>
        </Grid.ColumnDefinitions>
        <!--This is the hidden helper Field which is used to bind to, using the "Fill" column of the helper grid-->
        <Grid Grid.Column="1" x:Name="helperField"/>
    </Grid>
    

    You could also find some other solution at the following link:

    http://social.msdn.microsoft.com/forums/en-US/wpf/thread/3ee5696c-4f26-4e30-8891-0e2f95d69623/

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

Sidebar

Related Questions

i want to make a tri-state checkbox inside listview control, iam using image list
I'm using a System.Windows.Forms.ListView control in my application with its View property set to
What are the benefits of using a datagrid vs repeater vs ListView control (asp.net
I want to delete a row in ListView Control using Command and CommandParameter like
I want to get some data to fill a listview control, but this data
I want to implement an apperance as this article mentioned using nested ListView control.
I'm using a WPF ListView control which displays a list of databound items. <ListView
Is there any way creating a photo gallery using Listview control ? Im playing
I'm using a ListView control in the details view with VirtualMode set to true
The documentation of the ListView control (using WinApi) seem to lack some basic information,

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.