Home Dashboard Directory Help
Search

Refresh Problem with DataGrid RowDetails by ketelsb


Status: 

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)
view
1
User(s) can reproduce this bug

Description

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
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.
File Name Submitted By Submitted On File Size  
DataGridRowDetails.zip 10/12/2010 1.78 MB
DataGridRowDetails.zip 10/12/2010 1.78 MB