开发者

silverlight datagrid is being populated with 2 rows only

开发者 https://www.devze.com 2023-04-13 05:28 出处:网络
I have created a sample silverlight application and开发者_如何学JAVA trying to populated DataGrid with Data from a database table.

I have created a sample silverlight application and开发者_如何学JAVA trying to populated DataGrid with Data from a database table.

I have created this application using WCF Ria Services and Entity framework. When I run my application in the webbrowser I can see only 2 rows being displayed in the datagrid while the query should return more number of rows. I have attached SQL Server profiler to the database to see what the query is being sent. There is no problem in it, the query is returning all the rows.

My XAML in the MainPage.xml is as follows.

<sdk:DataGrid AutoGenerateColumns="True"  Name="RDataGrid"/>

and in the code behind I am binding to datagrid as follows:

Server.Service.RDomainContext context = new Server.Service.RDomainContext();
            RDataGrid.ItemsSource = context.s_structures;


            LoadOperation<Server.Service.s_structures> loadop = context.Load(context.GetS_structuresQuery());

I am new to silverlight and I did not understand how to find out whats going wrong in the application. Any help much appreciated.

BTW i have broke my application in to different modules following this link.

Thanks in Advance.


Finally I found the answer for this question. The problem was I was setting the ItemsSource to wrong thing. I should set the RDataGrid.ItemsSource = loadop.Entities.

0

精彩评论

暂无评论...
验证码 换一张
取 消