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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:15:37+00:00 2026-05-14T15:15:37+00:00

I have a problem with the new DataGrid component that comes with .NET4. The

  • 0

I have a problem with the new DataGrid component that comes with .NET4. The problem occurs when using RowDetails. With RowDetails the total height of the grid is increased when an element is chosen. This is necessary to show all Rows and the RowDetails, and exactly what I expect. When choosing another row the first RowDetails will collapse and the details for the newly selected row is expanded. The problem now is that the total height of the DataGrid seems to include the collapsed rowdetails of the previous element. My guess is that it first opens the new row details, and then collapses the old – and never resize to smaller sizes.

Consider this simple DataGrid:

<DataGrid ItemsSource="{Binding Cars}" Background="Blue" SelectionMode="Single" AutoGenerateColumns="True" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="20,20,0,0" Width="450">
    <DataGrid.RowDetailsTemplate>
        <DataTemplate>
            <StackPanel Orientation="Vertical">
                <TextBlock>Presenting the car details:</TextBlock>
                <TextBlock Text="{Binding Brand}"></TextBlock>
                <TextBlock Text="{Binding CarColor}"></TextBlock>
            </StackPanel>
        </DataTemplate>
    </DataGrid.RowDetailsTemplate>
</DataGrid>

It also requires a few lines in the codebehind:

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        DataContext = new MyViewModel(); 
    }
}

public class MyViewModel
{
    private readonly ObservableCollection<Car> _cars = new ObservableCollection<Car>();

    public MyViewModel()
    {
        _cars.Add(new Car("Toyota", "Silver"));
        _cars.Add(new Car("VW", "Black"));
        _cars.Add(new Car("Audi", "Blue"));
    }

    public ObservableCollection<Car> Cars
    {
        get
        {
            return _cars; 
        }
    }
}

public class Car
{
    public Car(string brand, string color)
    {
        Brand = brand;
        CarColor = color; 
    }

    public string Brand { get; set; }
    public string CarColor { get; set; }
}

Select one element, then another one – and you will see that the blue background of the DataGrid is showing.

Is there any way I can fix this problem? I’m assuming this is a bug in the component. If there is no solution; can someone tell me where to report the bug?

  • 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-14T15:15:37+00:00Added an answer on May 14, 2026 at 3:15 pm

    I had the same issue when the DataGrid was in the WPF Toolkit, and couldn’t find a solution then either. If anyone has a solution to me – please shout out! But I’m guessing this is a bug in the component, and filed a bug report to Microsoft.

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

Sidebar

Related Questions

I do not have problem as such but I am quite new to Ruby.
Following on from my previous question [link text][1] , I have a new problem.
I have problem in some JavaScript that I am writing where the Switch statement
I have a problem using the Java search function in Eclipse on a particular
Let's say you have a form with a component that displays data from a
I have a datagrid column with a button that opens a modal dialog box
my problem is here: I have some class public class Component { ... private
I have problem with updating my datagridview after inserting new data to table. It
Today i have new problem with JPA/EJB3. I have 2 table User and Group
I have a new web app that is packaged as a WAR as part

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.