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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:27:52+00:00 2026-05-30T21:27:52+00:00

if I set a datagrid with 3 fixed width columns everything works as expected

  • 0

if I set a datagrid with 3 fixed width columns everything works as expected (the 3 columns measure 100):

<Window x:Class="DataGridTest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<DataGrid HorizontalScrollBarVisibility="Visible" >
    <DataGrid.Columns>
        <DataGridTextColumn Width="100" Header="A" />
        <DataGridTextColumn Width="100" Header="B" />
        <DataGridTextColumn Width="100" Header="C" />
    </DataGrid.Columns>
</DataGrid>
</Window>

If I change one column to Width * when you resize the window making it smaller all of them change their width.

<Window x:Class="DataGridTest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<DataGrid HorizontalScrollBarVisibility="Visible" >
    <DataGrid.Columns>
        <DataGridTextColumn Width="*" Header="A" />
        <DataGridTextColumn Width="100" Header="B" />
        <DataGridTextColumn Width="100" Header="C" />
    </DataGrid.Columns>
</DataGrid>
</Window>

Is this the expected behavior or is it a bug in WPF?

  • 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-30T21:27:53+00:00Added an answer on May 30, 2026 at 9:27 pm

    this is how the datagrid works by default: the width you set on the columns is only the original width. And then when you size the datagrid down, it resizes ALL columns, independently of their original widths.

    if you want your columns to keep their widths no matter what (and show a scrollbar instead, for instance), you should use MinWidth instead/as well

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

Sidebar

Related Questions

My DataGrid has a default set of columns to display, but I'd also like
Is there a way to set a fixed column size in Dojo DataGrid, and
I have a DataGrid and I set the DataProvider to my data. When my
How can I set ID to TabelRows generated by DataGrid/DataList ? I want to
I have a data set whose elements are displayed as rows in a DataGrid.
I've a custom itemRenderer for my datagrid. To set the actual data I use
Trying to figure out how to use EventToCommand to set a datagrid double click
I've set up my DataContext like this: <Window.DataContext> <c:DownloadManager /> </Window.DataContext> Where DownloadManager is
I'm trying to set the ItemsSource property of a DataGrid named dgIssueSummary to be
I have a DataGrid who's RowDetails is set to show when selected (RowDetailsVisibilityMode=VisibleWhenSelected). Now

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.