Problem with using ICustomTypeDescriptor

5 posts, 1 answers
  1. Thomas
    Thomas avatar
    30 posts
    Member since:
    Oct 2012

    Posted 07 Nov 2012 Link to this post


    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.

  2. Ivan Petrov
    Ivan Petrov avatar
    717 posts

    Posted 12 Nov 2012 Link to this post

    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.
  3. Kristoffer
    Kristoffer avatar
    158 posts
    Member since:
    Dec 2012

    Posted 11 Feb 2013 Link to this post

    Running your latest build here. ICustomTypeDescriptor is not supported, as it seems. My converter functions are never called.

    Please tell me I'm wrong!

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

    It works. Sorry :)
  4. Thomas
    Thomas avatar
    30 posts
    Member since:
    Oct 2012

    Posted 12 Feb 2013 Link to this post

    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?
  5. Answer
    Ivan Petrov
    Ivan Petrov avatar
    717 posts

    Posted 14 Feb 2013 Link to this post

    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.

    Ivan Petrov
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Back to Top