Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 28, 2012 01:34 AM by IAmTheWalrus
Dec 22, 2012 01:53 AM|LINK
From what I've found online it seems that Filters just appear when you create a dynamic data site. But that's not the case for me. I am using .net 4, vs 2010, and my site is based on Linq2SQL model. Everything works just fine except I dont see filters. Do
I needd to to do something special for filters to show on my table?
Dec 22, 2012 04:08 AM|LINK
In my experience I have seen that this will only happen if your entities are properly joined by means of foreign keys ... try doing a littele reverse engineering with Northwind and you might see how it works
Carlos N. Porras
Dec 22, 2012 10:28 AM|LINK
Hi IAmTheWalrus, the default filters are based on
if you have niether of these in your model you will not get filters.
Dec 22, 2012 11:35 AM|LINK
Thanks for your reply. The nature of my databse is such that there are no FK's, each table is an entity unto itself and does not link to any other.
Does this mean that I cannot have filters? Or that I must code the filtering myself?
Dec 22, 2012 03:41 PM|LINK
Yes you czn have filters no poroblem just not the default automatically generated ones. have a look at my NuGet package here
Dynamic Data 15 Custom Filters you can add these usign the [FilterUIHint("FilterName")] Attribute see details
Dec 24, 2012 01:21 PM|LINK
I did a NuGet on that package and all installed without a problem. I then set up the uihint like you say but still get nothing. Here's what I have:
I only added one field to test it:
public partial class ModelTable
public virtual int ModelTableField
My context is properly registerd as everything still works as before on the interface, it's just that I don;t get a filter showing up. I haven't tried a different kind of filter for that field, but i imagine these filter don;t care about type.
Dec 27, 2012 09:38 AM|LINK
Hi there, are you sure you are on a .Net 4 project as there are no custom filters in the default .Net 3.5 sproject.
Dec 27, 2012 01:34 PM|LINK
Yes it is .Net 4. But what I'm wondering now if if this works with my ORM generator Plinqo (codesmith.) Perhaps I should predefine this custom field in the dbml. Of couse that would defeat the purpose of adding a custom calculated column because I'd have
to recreate it every time the dbml was re-generated.
I'm going to try a new project without plinqo and use one of the the default options.
Dec 27, 2012 03:07 PM|LINK
OK, so I think I see what the problem is. My partial table class is not being recognized, this is my model class to which I add the custom code, but this has to be part of the main table class assembly. And it's because the main part of the table object
class is defined in another project and partial classes can only be defined within the same project. This means that I cannot use Plinqo, or at least I cannot use the instance of plinqo defined in the data obeject of my solution. I would either need to have
a second plinqo generator in this new project or I would have to use the standard project template and generate my own orm thru linq to sql. :)
Dec 28, 2012 12:35 AM|LINK
Since your problem is found, so is your problem solved?
I come here to check and make a confirmation.