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

[Solved] Dataset

3 Answers 157 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.
NS
Top achievements
Rank 1
NS asked on 09 Sep 2009, 01:02 PM
Hi,

I've made an application with datasets for silverlight (http://silverlightdataset.net/silverlightdataset/Default.aspx) but i'm not able to let the radgrid create the columns.

If i bind the dataset to a standard datagrid it's rendered correctly, but with the radgrid it doesn't.

Can you advise?

Regards

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 09 Sep 2009, 01:18 PM
Hi NS,

Can you send us an example where this can be reproduced? Other possible approach is to try my DataTable instead.

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
NS
Top achievements
Rank 1
answered on 09 Sep 2009, 01:38 PM
Hi Vlad,

My wcf service does the following:

im using the following dll's

using

 

Microsoft.Practices.EnterpriseLibrary.Data;

 

using

 

System.Data;

 

using

 

Silverlight.DataSetConnector;

 


DbProviderFactory fact = DbProviderFactories.GetFactory(ProviderName);  
 
Database database;  
DbCommand dbCommand = null;  
DataSet data = new DataSet();  
string StringData = "";  
database = Unilin.Data.EnterpriseLibrary.DatabaseFactory.CreateDatabase(ConnectionString, ProviderName);  
dbCommand = database.GetSqlStringCommand("select * from persons);  
database.LoadDataSet(dbCommand, data, "Persons");  
StringData = Connector.ToXml(data);  
              
if (dbCommand != null)  
    dbCommand.Dispose();  
              
 
return StringData; 
The code above goes and returns all the lines from the persons table and creates an xml string (dataset info) and sends it to the silverlight app.

In the silverlight app i call the service above (so i get the xml-string)
On the complete event a do the following code.

using

 

Silverlight;

DataSet dataSet = new DataSet();  
dataSet.FromXml(e.Result);  
Connector connector = new Connector();  
 
radgridItems.AutoGenerateColumns = true;  
 
gridItems.ItemsSource = dataSet.Tables["Persons"].GetBindableData(connector);  
radgridItems.ItemsSource = dataSet.Tables["Persons"].GetBindableData(connector);  gridItems.ItemsSource; 
It casts the xml-string to a dataset and binds it to a radgrid and a standard datagrid.

The standard datagrid everything is autogenerated correctly.
In the radgrid it doesn't generate any columns but shows the correct number of rows.

Regards
0
Vlad
Telerik team
answered on 09 Sep 2009, 01:59 PM
Hi NS,

Unfortunately I didn't found any download link to try this - can you send us small project via support ticket?

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
NS
Top achievements
Rank 1
Answers by
Vlad
Telerik team
NS
Top achievements
Rank 1
Share this question
or