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

Dynamic data binding

2 Answers 98 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.
MAQ MA
Top achievements
Rank 1
MAQ MA asked on 07 Apr 2012, 10:59 AM
Hi,

I am using RadGridView for dynamic data binding. I have used Silverlight Enabled WCF service, which returns me IEnumerable<Dictionary<string, object>>

When I add watch on the service method I can see the proper datatable (Put a watch on table variable in GetData() method). The problem here is very typical I cannot see the data visible in the cells of the gridview except for the first column. Though if I see the filters on the columns I can see the relevant data on it and the grid is filtered also accordingly. So I assume the grid is binded correctly but then why I am not seeing the data.
Also I would like to know how can I apply conditional style cell selectors when my grid columns are getting generated at the runtime.
Download the  file for the sample code. https://skydrive.live.com/embed?cid=E4A632AEF706BBF7&resid=E4A632AEF706BBF7!270&authkey=ADQzUM7yDkLzadE
The project uses the database so first please create the database called MyQTest and then execute the script file (also in the zip). This file will create the require tables along with the data.
Also please change the connectionstring in the web.config accordingly.

Thanks

2 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 07 Apr 2012, 02:02 PM
Hello,
MAQ MA

In case you see the correct number of rows, but blank cells , you need to setup the DataMemberBindings for the columns properly .

In case you need a sample project reviewed by us , I would strongly advise to use the standard workflow  - opening a support ticket and attaching the runnable project to it

Greetings,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
MAQ MA
Top achievements
Rank 1
answered on 08 Apr 2012, 10:17 AM
Hi
thanks for your response. I am using the sample code which i downloaded from this blog post http://blogs.telerik.com/vladimirenchev/posts/11-09-28/dynamic-binding-for-your-silverlight-applications.aspx 

If you see the code it does not uses explicitly data binding of columns but just set the ItemsSource property. As this grid will bind completely dynamic manner. I cannot presume how many columns will be there in that grid , what will be the column names etc etc.
Hence there is no design time xaml involved over here. Hence I am not sure how will i do data member binding to the columns. I request you to glance my code once and suggest me if i am going wrong somewhere.

Thanks

Tags
GridView
Asked by
MAQ MA
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
MAQ MA
Top achievements
Rank 1
Share this question
or