This is a migrated thread and some comments may be shown as answers.

Inner Grid Flashing on NotifyPropertyChanged of Parent

15 Answers 91 Views
GridView
This is a migrated thread and some comments may be shown as answers.
yonadav
Top achievements
Rank 1
yonadav asked on 27 Jan 2010, 10:54 AM
Hi,

We're using the inner grid feature of the GridView control quite heavily and have encoutered an odd problem:
Whenever the parent row's viewmodel fires a NotifyPropertyChanged event, the inner grid is completely redrawn. Since the inner grid's columns use fill width the whole inner grid flashes. Oddly enough, the parent row appear okay.

Any idea why this is happening and how to avoid it?

<telerik:RadGridView  
            RowIndicatorVisibility="Hidden" 
            AutoGenerateColumns="False" 
            ShowGroupPanel="False"  
            RowDetailsVisibilityMode="VisibleWhenSelected" 
            Name="MainGrid" 
            ItemsSource="{Binding Alerts}" 
            ShowColumnHeaders="True" 
            > 
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn Name="Headline" EditTriggers="None" 
                                            DataMemberBinding="{Binding Headline,Mode=OneWay}" /> 
            </telerik:RadGridView.Columns> 
            <telerik:RadGridView.ChildTableDefinitions> 
                <telerik:GridViewTableDefinition  
                    AutoGenerateFieldDescriptors="False" 
                    > 
                    <telerik:GridViewTableDefinition.Relation> 
                        <telerik:PropertyRelation  
                            ParentPropertyName="DescriptionLines" /> 
                    </telerik:GridViewTableDefinition.Relation> 
                </telerik:GridViewTableDefinition> 
            </telerik:RadGridView.ChildTableDefinitions> 
            <telerik:RadGridView.HierarchyChildTemplate> 
                <DataTemplate> 
                    <Grid> 
                        <telerik:RadGridView  
                            RowIndicatorVisibility="Hidden" 
                            AutoGenerateColumns="False" 
                            ShowGroupPanel="False"  
                            RowDetailsVisibilityMode="Collapsed" 
                            ShowColumnHeaders="True" 
                            ItemsSource="{Binding DescriptionLines}" 
                            ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                            RowLoaded="ChildGridView_RowLoaded" 
                            ColumnsWidthMode="Fill" 
                            Margin="10,10,10,10" 
                            > 
                            <telerik:RadGridView.Columns> 
                                <telerik:GridViewDataColumn  
                                    Header="Device Name" 
                                    MaxWidth="300" 
                                    EditTriggers="None" 
                                    > 
                                    <telerik:GridViewDataColumn.CellTemplate> 
                                        <DataTemplate> 
                                            <ContentPresenter Content="{Binding AssociatedViewModel}" /> 
                                        </DataTemplate> 
                                    </telerik:GridViewDataColumn.CellTemplate> 
                                </telerik:GridViewDataColumn> 
                                <telerik:GridViewDataColumn  
                                    Header="Description" 
                                    DataMemberBinding="{Binding Description}"  
                                    TextWrapping="Wrap" 
                                    EditTriggers="None" 
                                    /> 
                                <telerik:GridViewDataColumn  
                                    Header="" 
                                    MaxWidth="100" 
                                    EditTriggers="None" 
                                    > 
                                    <telerik:GridViewDataColumn.CellTemplate> 
                                        <DataTemplate> 
  
                                            <!-- This contains a RadDropDownButton, I've cut it out now -->  
                                        </DataTemplate> 
                                    </telerik:GridViewDataColumn.CellTemplate> 
                                </telerik:GridViewDataColumn> 
                            </telerik:RadGridView.Columns> 
                        </telerik:RadGridView> 
                    </Grid> 
                </DataTemplate> 
            </telerik:RadGridView.HierarchyChildTemplate> 
 
        </telerik:RadGridView> 

Thanks,
yonadav

15 Answers, 1 is accepted

Sort by
0
yonadav
Top achievements
Rank 1
answered on 02 Feb 2010, 06:33 AM
Hi Everyone,

Anyone had a chance to look at this? We are really interested in finding a solution to this.

Thanks,
yonadav   
0
Vlad
Telerik team
answered on 02 Feb 2010, 07:12 AM
Hello,

Can you post more info about the grid version?

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
yonadav
Top achievements
Rank 1
answered on 02 Feb 2010, 03:25 PM
Hi Vlad,

We're using 2009 Q4. 

Is there any information we can supply to assist in the identification of a solution?

Thanks,
yonadav
0
yonadav
Top achievements
Rank 1
answered on 03 Feb 2010, 05:04 PM
Hi Vlad,

After some tinkering over here we have found out that:
1. The GridView as a child grid view behaves somewhat differently than a GridView that is not a child grid (for example, the EditTriggers="None" doesn't work).
2. LayoutUpdated event fired by a grid gets a null sender.
3. In order to avoid having the childgrid flash, we've hooked the SizeChanged event of the child grid and we set the widths of all columns in code. While it's obvious to us the GridView refreshes itself with each PropertyChanged of its parent, it's not really obvious in the UI because the sizes of the columns and rows don't change (we've locked them in with the SizeChanged handler).
4. There is also a weird behavior with the child grid view and the "Fill" column width mode. For some reason, it doesn't really fill the grid and there's some space on the right which doesn't belong to any column. This is as opposed to the other grids we're using (non child) which manage to fill the space correctly.

Bottom line - something's a bit fishy with the child grids. If there's any more information we can provide to help please let me know.

Thanks,
yonadav
0
Vlad
Telerik team
answered on 04 Feb 2010, 06:31 AM
Hi Yonadav,

Please upgrade to our latest service pack (Q3 2009 SP2) and let me know if you still have such problems.

Greetings,
Vlad
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
yonadav
Top achievements
Rank 1
answered on 04 Feb 2010, 08:30 AM
Hi Vlad,

I might be missing something, but given we're using Q4 2009 (and specifically, the docking component there), wouldn't going to Q3 SP2 be essentially going back for us?

Thanks,
yonadav    
0
Vlad
Telerik team
answered on 04 Feb 2010, 08:43 AM
Hello Yonadav,

We don't have Q4 2009 version of our components. We switched to three releases three years ago.

Sincerely yours,
Vlad
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
yonadav
Top achievements
Rank 1
answered on 04 Feb 2010, 03:21 PM
Hi,

Sorry for the confusion. We have now moved to Q3 SP2. However, we've run into the following (each an issue of its own):

1. The move to SP2 did not resolve the problems we were experiencing, and have actually made things worse. The child grids flash more than they did before.

2. The RadContextMenu is behaving oddly (and it didn't prior to the move). Sometimes, it doesn't disappear after it executes a Command associated with a RadMenuItem.

3. We've now run into a new issue (which we're not sure was there prior to the move to SP2). We have a grid which receives a CollectionView which contains objects of different types (let's say A and B). We're getting an exception saying:
The value "B" is not of type "A" and cannot be used in this generic collection.\r\nParameter name: value
With the following stack trace:
  mscorlib.dll!System.ThrowHelper.ThrowWrongValueTypeArgumentException(object value, System.Type targetType) + 0x7b bytes
  mscorlib.dll!System.Collections.Generic.List<System.__Canon>.VerifyValueType(object value) + 0x63 bytes
  mscorlib.dll!System.Collections.Generic.List<A>.System.Collections.IList.Add(object item = {B}) + 0x37 bytes
> Telerik.Windows.Data.dll!Telerik.Windows.Data.CollectionViewQueryableProxy.CreateQueryableView() Line 94 + 0xc bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.CollectionViewQueryableProxy.QueryableView.get() Line 64 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.CollectionViewQueryableProxy.Provider.get() Line 44 + 0x9 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableExtensions.Count(System.Linq.IQueryable source = {Telerik.Windows.Data.CollectionViewQueryableProxy}) Line 319 + 0x9 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.UpdateTotalItemCount() Line 669 + 0x12 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.QueryableCollectionView(System.Collections.IEnumerable sourceCollection = {System.Windows.Data.ListCollectionView}) Line 57 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.DataItemCollection.CreateCollectionView(System.Collections.IEnumerable source = {System.Windows.Data.ListCollectionView}) Line 550 + 0x37 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.DataItemCollection.SetItemsSource(System.Collections.IEnumerable source = {System.Windows.Data.ListCollectionView}) Line 523 C#
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.Bind.AnonymousMethod() Line 3759 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(System.Windows.FrameworkElement frameworkElement = {Telerik.Windows.Controls.RadGridView}, System.Action action = {Method = {Void <Bind>b__43()}}) Line 16 + 0xb bytes C#
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.Bind(object newValue = {System.Windows.Data.ListCollectionView}) Line 3804 C#
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.OnApplyTemplate() Line 2804 C#

Can you assist us with resolving each of the above?

Thanks,
yonadav
0
Stefan Dobrev
Telerik team
answered on 10 Feb 2010, 07:01 AM
Hi yonadav,

Please find my answers in order:
  1. I have looked at the XAML you have provided, but it is almost impossible to guess why you experiencing this flickering. It would be best if you could open a support ticket and attach your application there. This was we will be able to look at it and provide you with a solution faster.
  2. Again without sample application which illustrates this odd behavior we cannot do much.
  3. This issue has already been reported to us and we plan to include a fix for it in the next latest internal build.
Best wishes,
Stefan Dobrev
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
yonadav
Top achievements
Rank 1
answered on 15 Feb 2010, 03:14 PM
Hi Stefan,

In order to circumvent the problem described above, we have changed somewhat the appearance of the view (no child grids, for example). Now, with the simplified version, it appears to be working well.

Regarding the mixed list issue (#3 in my previous message) - when will an internal build be ready?

Best regards,
yonadav
0
Stefan Dobrev
Telerik team
answered on 18 Feb 2010, 01:21 PM
Hello yonadav,

We will include a fix for this in the next latest internal build. It will be available at the end of this week.

Stefan Dobrev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
yonadav
Top achievements
Rank 1
answered on 24 Feb 2010, 03:02 PM
Hi Stefan,

Does build 1423 include the fix (it didn't appear so from the release notes)?

Thanks,
yonadav

0
Stefan Dobrev
Telerik team
answered on 25 Feb 2010, 09:21 AM
Hello yonadav,

Yes the latest internal build has a fix for this.

Kind regards,
Stefan Dobrev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
yonadav
Top achievements
Rank 1
answered on 25 Feb 2010, 09:49 AM
Hi Stefan,

This has indeed solved the problem.

When will these internal builds be merged into 2010 Q1?

Thanks,
yonadav
0
Hristo
Telerik team
answered on 25 Feb 2010, 04:10 PM
Hello Yonadav,

All fixes from the latest internal builds will be included in Q1 2010 which is expected in the first half of March.

Kind regards,
Hristo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
yonadav
Top achievements
Rank 1
Answers by
yonadav
Top achievements
Rank 1
Vlad
Telerik team
Stefan Dobrev
Telerik team
Hristo
Telerik team
Share this question
or