0

I am trying to use the ASP.NET Dynamic Data Filtering project, but I'm running into a problem during the configuration.

I'm following the instructions on the author's blog, and everything works like described. Then it tells me to change the datasource using the designer view. I am told to select the "GridDataSource" in the "Configure data source" wizard. This option is not there though.

I get all of the classes in my project, including the DataContext that was generated by Linq. When I choose "Show only DataContext objects", the dropdown ("Choose your context object:") is completely empty.

When I turn of the checkbox and choose my DataContext class, I get asked which table I want and all that. But, as the whole purpose of a Dynamic Data site is NOT to use one single table, that's not much help.

So I've looked at the instructions again and copied the resulting datasource from the example:

<asp:DynamicLinqDataSource ID="GridDataSource" runat="server" 
EnableDelete="True" EnableUpdate="True"></asp:DynamicLinqDataSource>

Which is exactly what I had, without the "WhereParameters" nodes in there.

Now, when I run the list page however, I get an exception about a missing datasource from the filtering component. Of course when I remove the DynamicFilterRepeater, it works again.

This is the meat of the exception:

[InvalidOperationException: Missing DataSource] Catalyst.Web.DynamicData.DynamicFilterRepeater.GetTable() in D:\Catalyst\Projects\DynamicData\Project\Trunk\DynamicData\DynamicData\DynamicFilterRepeater.cs:74 Catalyst.Web.DynamicData.DynamicFilterRepeater.GetFilters() in D:\Catalyst\Projects\DynamicData\Project\Trunk\DynamicData\DynamicData\DynamicFilterRepeater.cs:81 Catalyst.Web.DynamicData.DynamicFilterRepeater.OnInit(EventArgs e) in D:\Catalyst\Projects\DynamicData\Project\Trunk\DynamicData\DynamicData\DynamicFilterRepeater.cs:106

How do I make the DynamicFilterRepeater recognize my datasource?

I'm using VS2010 Pro, on a Win7 machine.

4

1 回答 1

1

你有没有看过你下载源代码时得到的示例项目。

在这里查看我的博客文章动态数据过滤 - 安装

于 2010-05-11T23:11:56.663 回答