Last post Jun 11, 2009 05:02 PM by msingareddy
Jun 10, 2009 11:25 AM|msingareddy|LINK
Does anyone have ideas or samples on how to setup filtering on a non-FK column? I'm using EF.
I have looked at the AutoComplteFilter samples but they are all for the FK columns. I need something similar for non-FK column.
Jun 10, 2009 12:47 PM|sjnaughton|LINK
See my article here
Dynamic Data Futures – Part 3 – AnyColumnAutocomplete Filter you may need to do some work to make it work under EF though.
Jun 10, 2009 01:37 PM|ricka6|LINK
DynamicFilter is designed for this. If you are using Linq to SQL, you can use it now with the
DynamicDataPreview4.zip - If you are using EF, you'll have to wait until Dev10 RTMs. From the
DataSourceQueryExtenderSamples – One of the new big features in ASP.NET 4 is the QueryExtender control. This control allows very simple filtering for data source controls for common operations that developers want to do like search for a string across columns,
check if the value of a column is in a certain range and other operations.
Jun 11, 2009 11:48 AM|msingareddy|LINK
Thanks Steve, I was able to integrate you AnyColumnAutoCompleteFilter into my EF project without any issues and it works great. But it doesn't work with the Integer PK columns. I noticed that in your article you referenced a forum thread where another user
had the exact same issue. Have you been able to figure why it doesn't work with numeric PK columns? PS: I don't want to use the Integer filter because it loads all values in a drop down and I will have upto 20,000 values in it.
Jun 11, 2009 12:24 PM|sjnaughton|LINK
I think you'll find that it is because you can't use LIKE or STARTSWITH with a non text column and that is what AutoComplete uses, those are text based SQL methods. [:(]
So I think this is not going to happen unless you make your PK filed text based.
Jun 11, 2009 05:02 PM|msingareddy|LINK
Thanks Steve, that explains it. I will convert my Integer PK field to a string type.
I need one more type of filter for filtering by date columns. Something that can support a date range on a date column would be best. Any ideas or resources you can point me to?
Thanks again for all your help.