Custom PropertyGridItemElement

1 Answer 84 Views
PropertyGrid
Piotr
Top achievements
Rank 1
Piotr asked on 11 Jun 2021, 08:52 AM

I created  ItemElementBlank class that is used for two separate types in the property editor. I want to display no text next to the property label. It works properly when properties are collapsed. When one of the properties are expanded seems that my display element is used in the wrong row ("OdstÄ™p linii" instead of "Alarm"). I coloured the control to a yellow gradient for a better view.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 11 Jun 2021, 09:51 AM

Hello, Piotr,

According to the provided information, it is not quite clear what is the exact custom implementation that you have. Could you please elaborate?

However, I suppose that the IsCompatible method is not overridden in the custom PropertyGridItemElement.  In order to avoid reusing of the custom element for other items, you can override the PropertyGridItemElement.IsCompatible method and control whether the custom element is applicable for the specific PropertyGridItem . In addition, it is necessary to create another PropertyGridItemElement which is not compatible with your custom item. A sample approach is demonstrated in the following help article:

https://docs.telerik.com/devtools/winforms/controls/propertygrid/custom-items 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
PropertyGrid
Asked by
Piotr
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or