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

SilverLight DataTable not binding correctly

4 Answers 172 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brian Graves
Top achievements
Rank 1
Brian Graves asked on 11 May 2010, 02:50 AM
I have a Silverlight DataTable (converted from XML) that I wish to bind to my RadGridView using ItemsSource.  If I use the GetBindableData function of the Silverlight DataTable, it binds and displays but all my DataFormatString and sorting is behaving incorrectly: all my data seems to be treated as string.  I was able to recreate the same behavior with the telerik sample project found here:
http://www.telerik.com/community/forums/silverlight/gridview/datamemberbinding-converter-broken.aspx

If I change the Item class to return string for each property, it breaks the DataFormatString (dollar amount formating doesn't show anymore) and DataType (causing the sorting is treated like string instead of decimal...example 5.99 appears last instead of before 10.99). 

I'm wondering if this has to do with the fact that the Silverlight DataSet is converted from XML and all values (regardless of data type) are being set to string.  But since my Silverlight DataTable has all the correct data types, shouldn't the RadGridView be able to convert to the correct type when the data is bound? Or is the GetBindableData() function causing a problem?

4 Answers, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 13 May 2010, 02:01 PM
Hello Brian,

Could you please share your XAML and code-behind? Or open a support ticket and attach your solution.

All the best,
Yavor Georgiev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Brian Graves
Top achievements
Rank 1
answered on 13 May 2010, 04:24 PM
The problems were completely caused by using the Silverlight DataSet that I found here:
http://silverlightdataset.net/silverlightdataset/Default.aspx

The properties in this particular DataSet are always set to string (useless!) in their GetBindableData() function.  I would highly recommend NOT using this solution as it was a total waste of time/development cost.

However, I found the use of the DynamicDataBuilder class in this posting VERY useful:
http://forums.silverlight.net/forums/p/16733/69252.aspx
0
Yavor Georgiev
Telerik team
answered on 14 May 2010, 01:05 PM
Hi Brian Graves,

 I'm glad you were able to resolve your issue. I was going to suggest our own Vladi Enchev's excellent DataTable for Silverlight implementation: http://blogs.telerik.com/vladimirenchev/posts/09-04-23/lightweight_datatable_for_your_silverlight_applications.aspx

Sincerely yours,
Yavor Georgiev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Brian Graves
Top achievements
Rank 1
answered on 14 May 2010, 06:36 PM
Thanks but your recommendation link doesn't address the implementation of the DataSet for the data service...only the Silverlight app.  Are you recommending that I only return XML (no DataSet) from the data service and parse through it to create a DataSet in the Silverlight app?  I'm not seeing the benifits of switching to this if that kind of coding is required.
Tags
GridView
Asked by
Brian Graves
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Brian Graves
Top achievements
Rank 1
Share this question
or