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.
Unfortunately, activation email could not send to your email. Please try again.

SfDataGrid work with dynamic columns implemented by ExpandoObject

Thread ID:

Created:

Updated:

Platform:

Replies:

114290 Nov 11,2013 07:53 AM Nov 20,2013 03:55 AM WinRT 1
loading
Tags: SfDataGrid
Keith Liang
Asked On November 11, 2013 07:53 AM

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

Narayanasamy J [Syncfusion]
Replied On November 20, 2013 03:55 AM

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 


CONFIRMATION

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.

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.

;