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

Is ICustomTypeProvider supported in RadGridView

3 Answers 115 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Veteran
Randy asked on 25 Oct 2017, 11:37 AM

Hi, wisers,

I'm using RadGridView (2013.2.0724.40) under .net 4.5 to display some objects whose properties will only be known at run time. Googled and it seems ICustomTypeProvider is a good fit. I implemented it to my class and tried to set RadGridView to AutoGenerateColumns = True. But the properties dynamically added to the class are not shown in the generated grid, only those fixed properties. I tried DataGrid in .net itself and it works fine, the dynamic properties are shown in the DataGrid in column.

It seems that RadGridView itself doesn't support ICustomTypeProvider like .net DataGrid. Is there any possibility to achieve this in RadGridView?

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 26 Oct 2017, 11:03 AM
Hi Randy,

Actually, RadGridView provides support for ICustomTypeProvider implementations. This is valid for the assemblies version you are using as well. As an example of such implementation, you can take a look at the Binding to ICustomTypeProvider SDK Example. It can be reviewed through the SDK Samples Browser.

Can you please check it out and let me know how it goes?

Best Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Randy
Top achievements
Rank 1
Veteran
answered on 27 Oct 2017, 06:24 AM

Hi Stefan,

Thank you for the response. I tried to install SDK Samples Browser, but unfortunately cannot connect to github. The error shot is attached. I'm not sure if that's because our domain or group policy blocks this connection, but I do be able to view github in a browser. Is there anything I could check to make it work?

And I went thru the code repository of the ICustomTypeProvider example on github. It seems in accordance with my implementation. But still the dynamic properties are not shown. I pulled the project in SDK sample and reference my gridview dll, no column is shown either. If I manually add columns in xaml, the column will show with combined value. But the filter is only available when setting DataType for that column. Even the filter dialog is available, the distinct values shown in the dialog do not reflecting the actual values. So it seems the example doesn't work either.

So then I dig a little into the souce of RadGridView, and found in ItemPropertyInfoHelper.GetPropertyDescriptors, ICustomTypeProvider is not taken into consideration. And in 2014.1.411.45 version dll, ICustomTypeProvider is processed with a new sub. So I guess in my version of dll ICustomTypeProvider is not supported by RadGridView. Could you help confirm this?

Thanks.

0
Stefan
Telerik team
answered on 31 Oct 2017, 03:20 PM
Hi Randy,

Thank you for the update.

With the provided information, however, I cannot figure out what is going on. Attached to my reply, you can find the archived SDK Example, to which I referred. Can you please modify it in a way that reproduces the behavior you are experiencing, open a new support thread and attach the example in it? I will gladly assist you further.

As to your concern regarding the support of the interface, as stated in my previous reply, I tested the control with the assemblies version you are using and it seemed to behave as expected.

Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Randy
Top achievements
Rank 1
Veteran
Answers by
Stefan
Telerik team
Randy
Top achievements
Rank 1
Veteran
Share this question
or