Silverlight重载DomainDataSource [英] Silverlight Reloading DomainDataSource

查看:71
本文介绍了Silverlight重载DomainDataSource的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用导出实用程序以csv格式导出datagrid的内容.

当页面加载时,网格加载所有数据.网格具有数据分页器.

当用户进行过滤时,我希望能够使用click事件导出数据.

我在后台加载了click事件,然后导出了内容,但是我仍然没有获取所有数据.

如何重新加载域数据源,然后导出所有过滤后的结果?

即使下面的代码比分页的数据更大,下面的代码仍然只返回部分数据.

I am using an export utility to to export the contents of a datagrid in csv format.

When the page loads the grids load all data. The grids have datapagers.

When the user filter''s, I want to be able to export the data using a click event.

I have a grid in the background that I am loading on the click event then exporting the contents but I''m still not getting all of the data.

How can I reload the domain datasource, then export all of the filtered results?

The following code is still only returning a portion of the data even though it''s a larger set than the paged data.

Contract_Profile2DomainDataSource.Load() 
    ExpGrid.ItemsSource = Contract_Profile2DomainDataSource.Data 
    Export(dg:=ExpGrid)

推荐答案

我花了一些时间来解决这个问题并解决问题,我做了以下工作:

1.将datagrid自动加载配置为false
2.在XAML中,将配置的域数据源负载大小设置为最大允许值.在特定的应用程序中,我有许多数据网格,因此最大负载大小根据数据库表的大小而变化.
3.在对象图中配置了域数据源的最大项目
It took me a while to work through this solution and to resolve the problem I did the following:

1. Configured the datagrid autoload to false
2. In the XAML, configured domain datasource load size to maximum allowed. I have many datagrids in the particular application so the maximum load size varied according to size of the database tables.
3. Configured the Domain Datasource''s maximum items in the Object Graph
<pre lang="xml"><behavior name="DomainService">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="655360" />
        </behavior>



4.消除了数据寻呼机中的页面大小
5.启用了一个应用过滤器按钮,该按钮可以很好地通过多个控件来吸收用户的输入并填充数据网格.

我的导出按钮现在可以完美运行,用户可以将所有行保存在csv或excel中.



4. Eliminated page size in the data pager
5. Enabled an apply filter button that nicely takes the user''s input through a number of controls and populates the datagrids.

My export buttons works perfectly now and the user can save all of the rows in the items source in csv or excel.


这篇关于Silverlight重载DomainDataSource的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆