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

Custom item elements not working with scroll bars

1 Answer 28 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Thilo
Top achievements
Rank 1
Thilo asked on 13 Sep 2014, 03:47 PM
Hi,

in one of my projects I use the code you described in your "Rad Property Grid Custom Item Elements" project here. This works fine as long as you do not have a scollbar in your property grid and move it. Attached you will find a fiew screen shots which show the problem: The button is moving from one property to another. During debugging I found out that the CreateItemElement event was only fired sometimes.

I am using UI for WinForms Q2 2014. Any help would be appreciated.

Thanks in advance,
Thilo

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 17 Sep 2014, 01:21 PM
Hello Thilo,

Thank you for writing.

This is expected since the control is using UI virtualization. This means that the items are reused for different properties when you are scrolling. This is controlled by the IsCompatible method and to overcome it you can recreate the method as follows:
public override bool IsCompatible(PropertyGridItemBase data, object context)
{
    PropertyGridItem item = data as PropertyGridItem;
    if (item != null && item.PropertyType == typeof(string) && item.Name == "SpecialText")
    {
        return true;
    }
    return false;
}

I hope this helps. Should you have any other questions do not hesitate to ask.
 
Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
PropertyGrid
Asked by
Thilo
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or