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

GridDataControl in Silveright, binding to XML or DataSet

Hello,

We want to use a GDC in a Silverlight page to display tables from an ad hoc query created by the user. Binding to a business object is not an option since we do not know ahead of time what format the data may be in. Ideally we would want to either bind to a DataSet or XML, yet DataSet is not available to Silverlight pages and apparently GDC does not bind directly to XML. Is there a solution for this problem?

Thanks,

Paul Sample
Senior Software Engineer, RSA Security


5 Replies

RA Rajasekar Syncfusion Team May 31, 2011 10:50 AM UTC

Hi Paul,

Thanks for your update.

We cannot bind the XML directly to the Silverlight Datagrid. But you can achieve your requirement by converting the XML Elements to the List. We have prepared the sample based on your requirement and please find the sample in the below location.

Sample: http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=SL_Grid_XML1002115001.zip

Please let us know if you have any queries.

Thanks,
Rajasekar




PS Paul Sample May 31, 2011 01:50 PM UTC

Hi Rajasekar,

The link is broken.

Regards,
-Paul



PS Paul Sample May 31, 2011 02:16 PM UTC

The link now works but your example does not meet our requirements. As I said in my initial post a list of business objects will not work because we do not know ahead of time what the data elements and columns may be. We are looking for something more generic like binding to a DataSet where we do not know ahead of time what the data may look like in terms of properties and fields

Regards,
-Paul



PS Paul Sample May 31, 2011 03:23 PM UTC

Just to clarify. We are looking to fill the GDC from a data query built by the user at run time. We will not know ahead of time what that data may look like

Regards
-Paul



RA Rajasekar Syncfusion Team June 1, 2011 03:31 PM UTC

Hi Paul,

Thanks for your update.

We cannot bind the XML data directly to the ItemsSource of the Silverlight DataGrid because it should be convert to Data Table or Dataset and then only we can to bind. Likewise we cannot bind the DB query without using Data Table. But, as you stated before in the framework itself there is no support for Data Table. so we cannot achieve this requirement. In Silverlight DataGrid, At present we can achieve this requirement only by using collection of objects.

Please let us know if you have any queries.

Thanks,
Rajasekar




Loader.
Live Chat Icon For mobile
Up arrow icon