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

Problem with using ICustomTypeDescriptor

4 Answers 180 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 07 Nov 2012, 03:15 PM

Hi.

I am using RadPropertyGrid to reflect the fields of my own class which is inherited from RadTreeNode. RadPropertyGrid displays all properties from my class and all properties from RadTreeNode but I need to filter only Valuable ones. I was using ICustomTypeDescriptor interface for solve this. This solution works fine for System.Windows.Forms.PropertyGrid but does not work with RadPropertyGrid. Please help me with my problem.

4 Answers, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 12 Nov 2012, 12:23 PM
Hi Thomas,

Thank you for writing.

I tried to reproduce the issue you have described, but everything on my machine works as expected. I would kindly ask you to send me an example project where you recreate your setup. This will allow me to investigate the issue you are experiencing further.

Looking forward to your reply.
 
Kind regards,
Ivan Petrov
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
0
Kristoffer
Top achievements
Rank 1
answered on 11 Feb 2013, 03:03 PM
Running your latest build here. ICustomTypeDescriptor is not supported, as it seems. My converter functions are never called.

http://www.differentpla.net/content/2005/02/using-propertygrid-with-dictionary

Please tell me I'm wrong!

UPDATE
I forgot to add this:
radPropertyGridNode.SelectedObject = new DictionaryPropertyGridAdapter(d);

It works. Sorry :)
0
Thomas
Top achievements
Rank 1
answered on 12 Feb 2013, 01:40 PM
Yes Ivan, ICustomTypeDescriptor works as expected, but only when single item is selected in property grid.
If I have selected multiple items then the filter doesn't work. 


var items = new object[] { new RadTreeNodeEx(), new RadTreeNodeEx() };
//this works fine as expected
radPropertyGridLeft.SelectedObject = new RadTreeNodeEx();
//this doesn't filter properties.
radPropertyGridRight.SelectedObjects = items;


Is there a some workaround to handle this?
0
Accepted
Ivan Petrov
Telerik team
answered on 14 Feb 2013, 02:29 PM
Hello guys,

Thank you both for writing.

@Kristoffer: I am glad you were able to resolve the issue you were experiencing.

@Thomas: I can confirm that there is an issue when setting the SelectedObjects property. I have logged it in our Public Issue Tracking System - PITS. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - PITS Issue. There is no workaround that will cover all possible cases but if you are only reducing the number of properties returned by the type descriptor you can hide properties in the property grid by setting the Visible property of the items:
this.radPropertyGrid1.Items[0].Visible = false;
Since our next release (Q1 2013) is very close we will not be able to include a fix there. However, we will do our best to fix it for the release that follows this one.

I have also updated your Telerik points for bringing this issue to our attention.

Should any of you have further questions, do not hesitate to write back.

Regards,
Ivan Petrov
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
PropertyGrid
Asked by
Thomas
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Kristoffer
Top achievements
Rank 1
Thomas
Top achievements
Rank 1
Share this question
or