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

Property grid blinking

8 Answers 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 30 Dec 2013, 01:37 PM

I faced an unexpected RadPropertyGrid behavior, when I was trying to collapse an arbitrary group in PropertyGrid.

 

When my application starts RadPropertyGrid is loaded. I need some groups in RadPropertyGrid to be collapsed initially.

I'm trying to subscribe to Loaded event and make a call to propertyGrid.CollapseGroup(groupName); But it doesn't work.

Exploring forum I came across another solution

Dispatcher.BeginInvoke(DispatcherPriority.DataBind, new Action(() => CollapseGroup(GroupName)));

 

It works but with some quirks. Control loads groups (which I suppose to be collapsed) and they are initially expanded. And about a half of a second later they collapse. So the control blinks on the start and this looks very annoying.

How can I avoid this group "blinkings"?

 

A sample project can be found here: http://ge.tt/2gV7ilB1/v/0?c

8 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 02 Jan 2014, 09:38 AM
Hello,

Thank you for sending a demo project to illustrate the issue you experience.

Indeed I am able to observe the flickering. The reason for it is that the group is first rendered as expanded and then it is collapsed. Unfortunately there is not other way - you will have it actually created before you can change its expanded/collapsed state.

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Pavel
Top achievements
Rank 1
answered on 04 Jan 2014, 06:19 AM
Hello, Didie,

thank you for the answer.

I do believe that this flickering was introduced in the last major release of controls. Actually I faced the problem after migration from 2013.2 to 2013.3. And there were no such problem before. So I'm sure the control was rendered as collapsed at the very beginning.

You can easily check this if you downgrade to the previous major release (2013.2).

0
Dimitrina
Telerik team
answered on 06 Jan 2014, 01:33 PM
Hello,

Actually the CollapseGroup() method was introduced with a later version - 2013 Q2 SP.

I have tested with this version and I observed the same behavior. How do you test at your end?

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Pavel
Top achievements
Rank 1
answered on 09 Jan 2014, 11:41 AM
Hello Didie,

yes, you're right. I modified code. You can check this version of the Behavior with 2013 Q2. It should work without blinking. And I need your advice to get the same result in the latest release. Thank you!

public class RadPropertyGridCollapseGroupBehavior : Behavior<RadPropertyGrid>
{
 protected override void OnAttached()
 {
  base.OnAttached();
  AssociatedObject.Loaded += AssociatedObject_Loaded;
 }
  
 protected override void OnDetaching()
 {
  AssociatedObject.Loaded -= AssociatedObject_Loaded;
  base.OnDetaching();
 }
  
 public string GroupName { get; set; }
  
 private void AssociatedObject_Loaded(object sender, RoutedEventArgs args)
 {
  CollapseGroup(GroupName);
 }
  
 private void CollapseGroup(string groupName)
 {
  var groupDefinition = AssociatedObject.ChildrenOfType<ContentPresenter>()
   .Select(contentPresenter => contentPresenter.DataContext).OfType<GroupDefinition>()
   .First(definition => definition.DisplayName == groupName);
  
  groupDefinition.IsExpanded = false;
 }
}

0
Dimitrina
Telerik team
answered on 14 Jan 2014, 09:05 AM
Hi,

In your code you collapse the GroupDefinition directly through setting its IsExpanded property.
I will investigate the case further and contact you back with more information. 

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Dimitrina
Telerik team
answered on 15 Jan 2014, 08:58 AM
Hi,

In my tests both the approaches for collapsing a Group initially work similarly. I can notice the flickering with both of them.

Basically, the code for the CollaseGroup method you wrote yourself just collapses the GroupDefinition. So there should be not much difference in the result as the built-in CollapseGroup(GroupName) method does the same.

If you believe the previous approach works for you better, then you can continue working with it.

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Pavel
Top achievements
Rank 1
answered on 16 Jan 2014, 06:09 PM
Hello, Didie,

unfortunatelly I can't use the former approach in the latest release of Telerik as it blinks. I believe there is no workaround for this right now.

And I also think it could be of use if you can implement this in a further release. Because if you have several property grids in a column (that is quite common in large applications) flicker would be really annoying
0
Vera
Telerik team
answered on 21 Jan 2014, 04:12 PM
Hi Pavel,

We will consider this request for future implementation but we cannot commit to any specific date or release where it will be available.

Regards,
Vera
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Pavel
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Pavel
Top achievements
Rank 1
Vera
Telerik team
Share this question
or