We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

SfDataGrid work with dynamic columns implemented by ExpandoObject

I evaluate Syncfusion WinRT grid control continuing with this thread http://www.syncfusion.com/support/forums/winrt/107968 .
I also need to create columns at runtime. I implemented with my DataTable class that use ExpandoObject as DataRow to implemente in WinRT.
I can bind the data to the grid. But when I click the column header, it throws exception at App.g.i.cs like this(in Chinese): 
"Specified cast is not valid."
System.InvalidCastException: 无法将类型为“SampleTest.DataRow”的对象强制转换为类型“System.Dynamic.IDynamicMetaObjectProvider”。
   at Syncfusion.Dynamic.DynamicHelper.GetValue(Object dyn, String propName)
   at Syncfusion.Data.DynamicPropertiesProvider.GetValue(Object record, String propName)
   at Syncfusion.UI.Xaml.Grid.GridDynamicPropertiesProvider.GetValue(Object record, String propName)
   at Syncfusion.UI.Xaml.Grid.GridQueryableCollectionViewWrapper.<GetDynamicFunc>b__d(String propertyName, Object record)
   at la


The exception type is InvalidCastException. What's wrong with my codes? 


SampleTest_40dcdf58.zip

1 Reply

NJ Narayanasamy J Syncfusion Team November 20, 2013 08:55 AM UTC

Hi Keith,

Thanks for using Syncfusion product,

We have analyzed your query. You can achieve your requirement by setting the “UseBindingValue” as true in the columns. We have modified your sample based on your requirement and it can be downloaded from the following location.

Sample: Sample.zip

Please let us know if you need further assistance.

Regards,

Narayanasamy 


Loader.
Live Chat Icon For mobile
Up arrow icon