Refresh Problem with DataGrid RowDetails - by ketelsb

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


2
0
Sign in
to vote
ID 612781 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 10/12/2010 2:53:59 AM
Access Restriction Public

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. 
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)