Search

Refresh Problem with DataGrid RowDetails by ketelsb

Closed
as By Design Help for as By Design

2
0
Sign in
to vote
Type: Bug
ID: 612781
Opened: 10/12/2010 2:53:59 AM
Access Restriction: Public
0
Workaround(s)
1
User(s) can reproduce this bug
http://forums.silverlight.net/forums/t/204721.aspx

I have a datagrid with rowdetails, but the data in the rowdetails is calculated.

When I select an item, I calculate the data that needs to be shown and update the Binding List of the DataGrid.

The rowdetails are not shown immediately. But when you scroll a little, they magically appear.

I fear this is a bug in the refresh of the RowDetails.
Details (expand)

Visual Studio/Silverlight/Tooling version

Silverlight 4

What category (if any) best represents this feedback?

 

Steps to reproduce

Create a DataGrid with RowDetails and Bind data after the DataGrid Binding was completed.

Example: On the SelectedItem Changed Binding, alter the Binding Collection.
See attached application.

Product Language

English

Operating System

Windows 7

Operating System Language

Dutch (Belgian)

Actual results

The RowDetails are not immediately shown. When you scroll a little, the are suddenly shown.

Expected results

The Rowdetails appear when the Binding source has been changed.
File Attachments
File Name Submitted By Submitted On File Size  
DataGridRowDetails.zip 10/12/2010 1.78 MB
DataGridRowDetails.zip 10/12/2010 1.78 MB
Sign in to post a comment.
Posted by Microsoft on 11/30/2010 at 3:22 PM
Hi,

The issue is the BookListItem class does not raise PropertyChanged for when the BookDetails changes. As a result, the TextBlock in the RowDetails is empty so it has 0 Height, and it appears that the RowDetails is not working. If the BookListItem implements INotifyPropertyChanged and raises PropertyChanged for BookDetails, you will see the issue go away:

    public class BookListItem : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        private string _bookdetails;

        public BookListItem(Book book)
        {
            Book = book;
        }

        public Book Book { get; set; }
        
        public string BookDetails
        {
            get
            {
                return _bookdetails;
            }
            set
            {
                if (_bookdetails != value)
                {
                    _bookdetails = value;
                    RaisePropertyChanged("BookDetails");
                }
            }
        }

        private void RaisePropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
Posted by Microsoft on 10/12/2010 at 3:21 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.