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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfDataGrid work with dynamic columns implemented by ExpandoObject

Thread ID:





114290 Nov 11,2013 12:53 PM UTC Nov 20,2013 08:55 AM UTC WinRT 1
Tags: SfDataGrid
Keith Liang
Asked On November 11, 2013 12:53 PM UTC

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? 


Narayanasamy J [Syncfusion]
Replied On 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.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon