.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Generic Column Filter

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :ASP.Net

I want to create a filter template that works like the foreign key filter template but that isn't for a foreign key column but instead just a string column.  The dropdown should be populated with the distinct values in the column.  I'm having trouble accessing the values in the column from the new template though.  I tried using GetColumnValuesFromRoute in Page_Init of the template but it's not returning anything in items below. 

            Dim items As IDictionary(Of String, Object)
            items = Column.Table.GetColumnValuesFromRoute(Context)

Any suggestions?

I'm using VS2010 and .Net 4.0. 

View Complete Post

More Related Resource Links

Filter by Computed Column



After looking for a driver to open legacy dbf drivers to connect, the next level trouble a have is this one:

first, i can retrieve the data but when trying to filter by a parameter (somesc columns) i get an error.

The error says about the database can't determine some blah blah!

The error is a columm tha is formated (  1234  ) about  8 space, fixed. The values in the query appears like that. I resolve this by Trimming Ltrim(ColumnName) and i get this (1234).

Now in SqlExpress, how can i filter by the new Trimmed Expression? (This is a primary key that the DBF use)


SELECT column1, column2, column3


SELECT Ltrim(column1) as NewExp, column2, column3
Where NewExpre = @NewExpres                  -Error-


How to filter the search result based on a column value?

I do have search scope scoped at a list which contains attachment. I will use this scope to search (full text search) on this list then I need to filter the result based on a column which is in the same list. How do I do that? Thank you.

Filter items with a date column with parameters start date and end date on a sharepoint list?

If I have alist with a view that has the columns Title, Status and Status Date and the view has some items. How Can I add a filter with two parameters, start date and end date, to only show records with status date equal to or greater than parameter start date and status date is less than or equal to parameter end date? This is a sharepoint online site and I can't create and deploy custom code, can use SPD though. Do I need to use SPD or is this something I can do in the list settings? Thanks in advance.   Edit: I had a look here http://www.endusersharepoint.com/2009/09/29/sharepoint-date-filter-filtering-a-list-by-greater-than-or-equal-to-date/ but I don't have the Date Filter web part.

Unable to add filter to a sharepoint DateTime Column

Hi ,I have a DateTime column in  a List. When I try to create a view the column doesnt appear in the folter Column List.When i create a calculated column out of the DateTime Column, the new calculated column appears in the Filter Column ListCan any one explain why?ThanksSrila

How to filter managed meta data column using page query string?

I have two managed term sets as follows: Articles:Downloads Projects:Downloads I am trying to use a content query web part to filter a list based on the above manged meta data column. I want to filter out only "Articles:Downloads" Scenario 1: When I edit the web part and directly set the filter option with the managed meta data column to "Articles:Downloads" it works fine. When I export the web part, in the .webpart file, the "FilterValue1" property has a value "Downloads|9096e43b-555d-4879-9acc-b4ada9ea9910". Scenario 2: I want the web part to get the filter information from query string [PageQueryString:pageType]. So I tried using these options: a) pageType=Downloads      This works but returns downloads under 'projects' as well. (i want downloads only under 'articles')  b) pageType=Articles:Downloads     Does not work and shows no records c) pageType = Downloads|9096e43b-555d-4879-9acc-b4ada9ea9910     Does not work. (This value is the same as one found in 'FilterValue1' of the static web part). c) pageType = Articles:Downloads|9096e43b-555d-4879-9acc-b4ada9ea9910     Does not work. d) pageType = 9096e43b-555d-4879-9acc-b4ada9ea9910     Does not work.   What am I missing here? Can some one please help?

Using Filter in SharePoint FormField Lookup Column


I have a FormField lookup column with multiselect, which is bound to a List.

I have a new requirement.. There will be a textbox and a filter button above the FormField and when ever the user enter something and click on the filter button, the FormField lookup value should be filtered depending upon the string value in the textbox.

Please help me if somebody already done something like this or if someone has some idea how to do it..

Filter DFWP by passing Form Column


Hi All,

Apologies for a ridiculous problem, but it's one I can't get past.

I have two lists:

Shops - this contains Shop addresses and Shop numbers. The Shop Number column has an underlying Field name of "Title". This is NOT the auto-gen ID column incidentally, it is a Text field that happens to contains numbers of shops.

Faults - this contains calls logged to each Shop - the user chooses a Shop Number (lookup column to Shops list) and then types the fault details.

I want user to be able to see Faults logged against each Shop when they view the Shop list item.

So I am editing the DispForm.aspx page for Shops, where I've added a DFWP containing fields from the Faults list.

How do I show only those items in the Faults list, where the Shop Number on the FAULTS list equals the Shop Number of the currently-displayed SHOPS list?

I've tried:

Creating a parameter Query String for ID - but that won't work because the ID passed in the URL is NOT the "Shop Number"

Creating a parameter From field - but what do I type to reference the Shop list and the Shop Number ("Title") column?

Creating a Filter? I've tried several, but I have no way to reference the Shop Number ("Title") column on the form.

I've created a Custom List for Shops, and dro

Column filter in datasheet view


Good day.

I have SharePoint 2007 installed. Im trying to filter rows in datasheet view. When i select first of columns and choose value from drop-down menu, it filters rows by this value of this column. I do same thing on second column, its works fine. But when i try to use filter on third column its displaying empy sheet, or sheet with not all rows. I meen, that i try to apply three filters on three different columns in time and its showing wrong result. Do anyone knows what the problem is?

Best regards,


how do i get a value of a column in the cube based on a filter at runtime?

Hi, I am a newbie to the cube development and definately MDX, though I’ve managed to create an basic inventory cube which includes sales and purchase tables.


But, I am stuck at a problem which I couldn't resolve without your help;


Say, I need to show SUM of a column [CostAmountPhysical] for a company and warehouse.

The query in SQL would be:


SELECT     ItemId

Third Party Filtered Lookup is showing RENDER FAILED on clicking to sort Lookup Filter Column.



i know this isn't a Microsoft Plug-in, but I have downloaded and installed the following third party control for WSS 3.0 (Not MOSS). 


Has anyone had this problem. For some reason when I try and sort on a "Filtered Lookup" field I get RENDER FAILED. The column is in my Document Library that has 2,462 documents.

I need to switch off sort on it if possible. I have tried doing with JQuery (using Web Content Web Part), but no luck. 

Can anyone help as this is so important - even if someone can tell me where to start looking in the database. Could it be an incorrect/corrupt link in database or XML Schema File?

Your help would be really appreciated in this hour of need.



Dynamic Column filter on table variable or temp table



I created a  procedure which first populates a table variable /temp table with data. Then based on input parameter (say, @ColumnNames) I want to filter the result set.

Here is the snippet I have created, -

create PROCEDURE [dbo].[GetAlerts]
	@roleId varchar(20),
	@fields sysname
declare @temp table(
	ID int,
	role_id varchar(20),
	CRITICALINFO varchar(1000));

    insert into @temp select * from dbo.commonalertdata where role_id= @roleId);

	declare @sql varchar(300);
	set @sql='select ' + @fields + ' from @temp';
	exec dbo.sp_executesql @sql; 

Then i tried to run it as follows, -


And It gave the following error.

Msg 1087, Level 15, State 2, Line 1

Must declare the table variable "@temp".

Now, I tried using table variable or temp table or even UDF with no good. Can anybody help me in getting dynamic columns from a calculated table valued result set like temp table / table variable / inline table valued UDF?

Column filter in Business Data List web part does not work for all fields


I have a BDC entity whose fields contain a variety of data – numbers, dates and strings.  When I use the business data list web part I find that some of the columns’ dynamic filtering (accessed from the list’s column header) doesn’t work.  For these problem fields, the filter values load correctly but when I select a value all records disappear.  Initially I thought this was limited to just string columns but there is one string column that does filter correctly.

Here are some things that may be useful to know:

1.       The datasource is a SQL view and all fields are varchar(255)


Creating a Generic Entity Framework 4.0 Repository

With .NET 4.0 right around the corner, I thought it would be cool to download Visual Studio 2010 beta 2 and start playing around with the next release of Entity Framework.

The initial release of Entity Framework came with a great deal of criticism. To make matters worse, there was a large uproar when it was rumored that Microsoft would be abandoning LINQ to SQL, in favor of Entity Framework. This was because, at the time, many developers felt Entity Framework was an inferior technology to LINQ to SQL. To set things right, Microsoft proactively moved forward with improving Entity Framework, in time for the 4.0 release of the .NET Framework. This is good news because my initial impressions, so far, have been nothing but positive.

A Generic Dialog ViewModel

I worked on a wpf viewmodel for dialogs, because it seemed strange to me that you needed for instance windows forms dialogs to open or save files in wpf. So I set about creating my own wpf dialogs. After creating the dialog viewmodels there still remained a small issue with the library and also I didn't have much time to write an article about it. I however published the library containing the viewmodels for dialogs with another article on my blog

Using jQuery to Filter Table Rows

The project is using the .net GridView control, so I had limited control over the output HTML code. Still, I think this code can work for most tables. One thing to notice: you should use the class "filterable" on your table or on one of its parents for the code to work.
First, we need a text box:

Tooltip for GridView Column Headers (ASP.Net)

I just wanted to add auto tooltips for my GridView headers. There are couple of ways but I don't want to use javascript and wanted to use simple 'title' attribute. It took couple of hours to get the working code supporting sortable columns. I thought it will be very useful for others. Here's the code and logic behind it.

GridView Multiple Filter AJAX Control

This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend