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

[Solved] Dynamic WCF Data

2 Answers 153 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Drew
Top achievements
Rank 1
Drew asked on 16 Nov 2010, 06:54 AM
Hi,

I'm building a basic GridView that will show Student results over a few years at a school.

All results are stored in SQL and are pulled via a WCF Service.

I am basically wondering how I would go about creating a "Dynamic Class" to store the results. i.e. rather than having Result2008, Result2009, Result2010 and then having to add Result2011 come next year, I would like to simply be able to have a class that dynamically updates.

Here is my current class:
    Public StudentID As Integer
    Public FirstName As String
    Public LastName As String
Public StudentID As Integer
Public FirstName As String
Public LastName As String
Public English2008 As Integer
Public English2009 As Integer
Public English2010 As Integer
Public Maths2008 As Integer
Public Maths2009 As Integer
Public Maths2010 As Integer

So basically, I'm wondering it's possible to have have one value, ie English As List(Of Integer), Maths As List(Of Integer).

Not sure if that makes sense.

Regards,
Drew
    Public StudentID As Integer
    Public FirstName As String
  
    Public StudentID As Integer
    Public FirstName As String
    Public LastName As String
 Public LastName As String

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 16 Nov 2010, 08:08 AM
Hi Drew,

 It will be better to use our lightweight DataTable if you want dynamic data in Silverlight. Please check these links for more info:

http://blogs.telerik.com/vladimirenchev/posts/10-01-22/how_to_serialize_your_datatable_to_silverlight_using_wcf_service.aspx

http://blogs.telerik.com/vladimirenchev/posts/09-04-23/lightweight_datatable_for_your_silverlight_applications.aspx

Kind regards,
Vlad
the Telerik team
See What's New in RadControls for Silverlight in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
0
Drew
Top achievements
Rank 1
answered on 16 Nov 2010, 10:29 PM
Thanks Vlad, that was exactly what I was looking for.

Regards,
Drew
Tags
GridView
Asked by
Drew
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Drew
Top achievements
Rank 1
Share this question
or