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

ICustomTypeDescriptor defect

1 Answer 34 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Vladimir
Top achievements
Rank 1
Vladimir asked on 08 May 2014, 06:51 AM
Hello! 

Symptoms: RadDataForm don not see custom properties of object which implements ICustomTypeDescriptor when RadDataForm.CurrentItem set and RadDataForm.ItemsSource is null.

Location ItemPropertyInfoHelper.cs(Telerik.Windows.Data.dll assembly Telerik.Windows.Data namespace):
private static PropertyDescriptorCollection GetPropertyDescriptors(QueryableCollectionView collectionView)
{
...
if (TypeExtensions.IsCompatibleWith(elementType, typeof (ICustomTypeDescriptor))) //code pass
        return ItemPropertyInfoHelper.GetPropertyDescriptorsForCustomTypeDescriptorElementType(collectionView);
...
}
 
public static PropertyDescriptorCollection GetPropertyDescriptorsForCustomTypeDescriptorElementType(QueryableCollectionView collectionView)
    {
      var customTypeDescriptor = ItemPropertyInfoHelper.GetCollectionViewRepresentativeItem(collectionView) as ICustomTypeDescriptor; //returns null
      if (customTypeDescriptor != null) return customTypeDescriptor.GetProperties(); //Never called when ItemsSource is not set
      else return null;
    }
 
private static object GetCollectionViewRepresentativeItem(QueryableCollectionView collectionView)
    {
      if (!collectionView.IsEmpty) return collectionView.GetItemAt(0); //collection is empty
      else return null;
    }

Can you confirm this behavior?
Telerik version 2013.3.1016.40

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 12 May 2014, 12:34 PM
Hello Vladimir,

Indeed, you are right. I have logged the issue in our Portal so that you can follow its progress. 
Thank you for reporting this, I updated your Telerik points accordingly. 

Regards,
Maya
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
DataForm
Asked by
Vladimir
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or