I would like to add a search text box to the top of the List.aspx page in my Dynamic Data Entities project. I found the
Dynamic Data Filtering project on codeplex but don't understand how to implement the filtering in my project as I can't find a good walkthrough.
I found
this link explaining how to install and implement Dynamic Data Filtering but it is about 3 years old and when following the directions they just don't seem to match up with what I'm doing.
It seems like this should be very simple. The one table I want to be able to filter has a column called "Project Number". I want to be able to type a project number in a text box and filter the table based on that. How can I do that? Thanks in advance.
Is there a simple tutorial link somewhere explaining how to use the "built in" filtering?
Yes, I've seen the 15 custom filters and installed the package. Is there a walkthrough somewhere that explains how to do something very simple, like add a search box for a single column in the table like I mentioned before? I just want to be able to type
a project number and filter on that. I am new to ASP.net and DD so I guess I need more specific direction?
Yes, I have seen that project also, but it does not work for me. I run it and click on a table, say the Products Table, and I get a SQL error shown below. The Northwind DB is included so why the error?
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
By the way I am using SQL Express 2008 and have other projects of my own (without filters) working.
you will need to give access to the Northwind DB which you can get off of codeplex.com, it's one the sample databases, also the filter are available via NuGet and will then work in your project just by adding them and then form NuGet.
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
I downloaded the Northwind.sql file from codeplex. I went into SSMSE and crated a new Northwind DB. I then rand the .sql script and it created all of the tables, etc.
Now I run the filters project and still get this error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
In your last post you say I need to "give access" to the Northwind DB. Well now that it is loaded, how do I do that? Thanks.
Now that the project runs I should have an easier time telling what is going on and should be able to get the filters working in my own sample. Thanks!
OK. I was able to get the CustomFilters project running. I also had to change my project to target the .net 4.0 framework (instead of 3.5). I successfully installed the 15 Custom Filters via NuGet. I see that added references to the project and loaded the
15 filters in my Filters folder under DynamicData.
Now, my DB has only one table and I want to use a Contains filter on a column in it. The table has a Project # column. I would like to put a search box at the top of the List.aspx page so I can type in a Project # and filter based on that.
Looking through your sample, I see the following code in the List.aspx page:
I have a few questions I guess. Is that the only location I have to do anything in order to get the filter to work? Also, how is it that the filters show up on only the list view of the products table? Can you give me a bit more guidance. I apologize for being such a noob and appreciate the help very much. Thanks.
outhowz42
Member
80 Points
121 Posts
How to implement Dynamic Data Filtering?
Feb 07, 2012 03:04 PM|LINK
I would like to add a search text box to the top of the List.aspx page in my Dynamic Data Entities project. I found the Dynamic Data Filtering project on codeplex but don't understand how to implement the filtering in my project as I can't find a good walkthrough.
I found this link explaining how to install and implement Dynamic Data Filtering but it is about 3 years old and when following the directions they just don't seem to match up with what I'm doing.
It seems like this should be very simple. The one table I want to be able to filter has a column called "Project Number". I want to be able to type a project number in a text box and filter the table based on that. How can I do that? Thanks in advance.
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: How to implement Dynamic Data Filtering?
Feb 07, 2012 05:04 PM|LINK
Hi outhowz42, the Dynamic Data Filtering project is for .Net 3.5 SP1 and not .Net 4 however there is already a built in more advanced filtering in .Net 4 I have also added a Adding a Multi-Column Search to the Default List page you could use that, I also have a series of custome filter you can add to any DD for .Net 4 site here on NuGet Dynamic Data 15 Custom Filters
Always seeking an elegant solution.
outhowz42
Member
80 Points
121 Posts
Re: How to implement Dynamic Data Filtering?
Feb 07, 2012 06:16 PM|LINK
Is there a simple tutorial link somewhere explaining how to use the "built in" filtering?
Yes, I've seen the 15 custom filters and installed the package. Is there a walkthrough somewhere that explains how to do something very simple, like add a search box for a single column in the table like I mentioned before? I just want to be able to type a project number and filter on that. I am new to ASP.net and DD so I guess I need more specific direction?
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: How to implement Dynamic Data Filtering?
Feb 07, 2012 06:30 PM|LINK
if you have foreign keys relationships to other tables it should just work see my post here Five Cool Filters for Dynamic Data 4
Always seeking an elegant solution.
outhowz42
Member
80 Points
121 Posts
Re: How to implement Dynamic Data Filtering?
Feb 08, 2012 12:11 PM|LINK
Yes, I have seen that project also, but it does not work for me. I run it and click on a table, say the Products Table, and I get a SQL error shown below. The Northwind DB is included so why the error?
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
By the way I am using SQL Express 2008 and have other projects of my own (without filters) working.
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: How to implement Dynamic Data Filtering?
Feb 08, 2012 12:46 PM|LINK
you will need to give access to the Northwind DB which you can get off of codeplex.com, it's one the sample databases, also the filter are available via NuGet and will then work in your project just by adding them and then form NuGet.
Always seeking an elegant solution.
outhowz42
Member
80 Points
121 Posts
Re: How to implement Dynamic Data Filtering?
Feb 08, 2012 12:53 PM|LINK
I downloaded the Northwind.sql file from codeplex. I went into SSMSE and crated a new Northwind DB. I then rand the .sql script and it created all of the tables, etc.
Now I run the filters project and still get this error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
In your last post you say I need to "give access" to the Northwind DB. Well now that it is loaded, how do I do that? Thanks.
outhowz42
Member
80 Points
121 Posts
Re: How to implement Dynamic Data Filtering?
Feb 08, 2012 02:37 PM|LINK
OK, I got the project to run! I had to change the connection string from the default that came with the project:
to this:
Now that the project runs I should have an easier time telling what is going on and should be able to get the filters working in my own sample. Thanks!
outhowz42
Member
80 Points
121 Posts
Re: How to implement Dynamic Data Filtering?
Feb 08, 2012 02:37 PM|LINK
.
outhowz42
Member
80 Points
121 Posts
Re: How to implement Dynamic Data Filtering?
Feb 08, 2012 03:02 PM|LINK
OK. I was able to get the CustomFilters project running. I also had to change my project to target the .net 4.0 framework (instead of 3.5). I successfully installed the 15 Custom Filters via NuGet. I see that added references to the project and loaded the 15 filters in my Filters folder under DynamicData.
Now, my DB has only one table and I want to use a Contains filter on a column in it. The table has a Project # column. I would like to put a search box at the top of the List.aspx page so I can type in a Project # and filter based on that.
Looking through your sample, I see the following code in the List.aspx page:
<asp:QueryableFilterRepeater runat="server" ID="FilterRepeater"> <ItemTemplate> <asp:Label runat="server" Text='<%# Eval("DisplayName") %>' OnPreRender="Label_PreRender" /> <asp:DynamicFilter runat="server" ID="DynamicFilter" OnFilterChanged="DynamicFilter_FilterChanged" /><br /> </ItemTemplate> </asp:QueryableFilterRepeater>