.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

Custom OR Filter on XsltListViewWebPart

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :SharePoint
Hi, I am having some issues getting a custom document library that is being viewed in an xsltListViewWebPart to filter the way I want it to.   I have found 2 ways to filter down the list using user input. 1.) Add values to the FilterOperations collection based on user input. This works great when you are only trying to filter on one column, or narrowing down searches based on columns. My issue with this method is that I can't search for values in multiple columns (Can do Column1 and Column2 but NOT column1 or column2) 2.) Modify the xmlDefinition of the xsltlistviewwebpart and inject my own query into the xml. This works greats on actually filtering, I can filter down on whatever I want, however, when I do this, I lose ribbon functionality on all but the items that originally appeared on the first page. If you searched for something that returned the 1st and 1530th files in the list, you could use the ribbon on the 1st item, but all document specific ribbon controls are disabled for the 1530th file. There are thousands of documents in this library and the only reason you would search for it is because you want to edit the properties or something, so this is kind of a big deal.   What I am looking for is the best way to filter down the document library dynamically using OR statements and user input.   Any help would be greatly appreciated.

View Complete Post

More Related Resource Links

Custom Alert Filter Definition

I was trying to create custom filter definition. Requirement : Send alert when the body of discussion contains certain words. These words are to be configurable. I just followed the steps in this blog. http://blogs.msdn.com/b/sharepointdeveloperdocs/archive/2007/12/07/customizing-alert-notifications-and-alert-templates-in-windows-sharepoint-services-3-0.aspx Created seperate template xml and added the definition like below <Filters> <FilterDefinition> <FriendlyName>Post contains </FriendlyName> <ShortName>words or phrase </ShortName> <Query> <Where> <Contains> <FieldRef Name="Body" /> <Value Type="Note">hi</Value> </Contains> </Where> </Query> </FilterDefinition> </Filters> I'm getting some blank radio buttons in the alert configure page, not sure whether to add the custom entries to resource file, where to make changes in core resource file? The value I'm trying to search is hardcoded now in the CAML, I want some text box for entering the value. Please advise.

Custom XSL stylesheet rendering for a XSLTListViewWebPart in SharePoint 2010

Hi, How can I apply the custom XSL rendering for the XSLTListView web part in SharePoint 2010? So, for example, I have a list of "Employees". Here is the list of columns I have for this Employee list - Full name, Job Title, Team, Contribution, Project. For this list I have created a new "List View" which has a grouping by Job Title. Then I have created a new page. In that page, I have added the Employees List and then in web part properties I have changed it to use the new List View (grouped by Job Title). I would like to control the HTML rendering of this web part and I don't know how do I achieve this? I do understand that by default a list view web part uses vwsytles.xsl and fldtypes.xsl stylesheets which are located in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS\XSL on the server. Should I grab these stylesheets and then change it and then point the web part to use these new ones? How do I change the web part to point to the stylesheets that I want to use instead of the default ones? I have also noticed that you can not even export the list view web part and change the properties and then import it back. I had a look at the web part properties (by clicking on "Edit Web Part"). The properties panel has "Miscellaneous" category which has the following properties - Sample Data, XSL Link etc

Custom listbox filter

Hi, I'm trying to create a multiselect listbox filter control.  I was using Josh Heyes filters but I'm upgrading to 4.0 and this is no longer compatible.  I have created a new UserControl which inherits from QueryableFilterUserControl, but I can't work out what I need to put into the GetQueryable method.  It's very similar to the ForeignKey filter, it's just that I want the user to be able to select multiple items in the list. Can anyone help? Thanks, Emma

Custom List View - filter blank value



I am creating a custom list view in SPD2010 and am having some problems. I want to have 3 filters (language, country and quarter). I have set these up as ASP drop down lists that auto postback and then I have defined the paramaters and linked them into the list filter.




This works fine and all 3 drop downs filter the list. The only problem I am having is if I want to search just on one column. The way I have it set up in the filter is

Country EQUALS [Country] AND
Language EQUALS [Language] AND
Quarter EQUALS [Quarter]

If I want to show all entries from Germany and not filter on Language and Quarter how do I do this? I have tried adding a "Please Select.." entry at the top of the list and setting the value to nothing but it does not work. I have had to create 3 seperate views but I would love to get these 3 filters working at the same time.

Is there a value in SP that I can use to filter on blank values or not consider the column at all? I have tried using nothing in the value and also tried NULL but neither have worked.

I have been trying to solve this for some time with no luck :( If anyone has any

Best Practice for connect SSRS Report Viewer Web part with custom filter web part (With Dropdown\Lis


To make a filter provider web part, I implemented the interface ITransformableFilterValues.
Implemented the various properties of the ITransformableFilterValues interface
and method that creates an instance of our filter provider.

[aspnetwebparts.ConnectionProvider("AccountFilter", "ITransformableFilterValues", AllowsMultipleConnections = true)]
public ITransformableFilterValues SetConnectionInterface()
return this;

Is this a best practice .Please share your suggestion.


Best Practice for connect SSRS Report Viewer Web part with custom filter web part (With Dropdown\Lis


To make a filter provider web part, I implemented the interface ITransformableFilterValues.
Implemented the various properties of the ITransformableFilterValues interface
and method that creates an instance of our filter provider.

[aspnetwebparts.ConnectionProvider("AccountFilter", "ITransformableFilterValues", AllowsMultipleConnections = true)]
public ITransformableFilterValues SetConnectionInterface()
return this;

Is this a best practice .Please share your suggestion.


How to pass multiple filter parameters to moss report viewer from custom filter provider


I have written a custom filter provider webpart which implements ITransformableFilterValues to pass parameter value to moss report viewer webpart.

However, this interface only allows to pass one parameter. Please can someone guide me through correct resource which allows my custom filter provider webpart to pass multiple parameters to report viewer. E.g if my report has 5 parameters then my filter provider webpart should allow me to make connection with report viewer and pass all 5 parameters.

Custom ribbon button on content type not shown in XsltListViewWebPart


Hello all,

As a bit of background: I'm currently busy developing a content type with some kind of status (waiting / in progress / done). I want to make the users life a bit easier to complete an item so I want to add a button to the ribbon that sets the selected items status to "Done".
This works when I go to the list and click on the item (I see my button and it works perfectly). The problem is that this button is not visible when I add a view of this list on the homepage, then suddenly my button does not show.

Does anybody know what can be done to also show the button inside the ribbon of the XsltListViewWebpart? Below is my elements.xml that I use.


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  Title="Add a Ribbon Button">
     <Button Id="Ribbon.ListItem.Actions.NewRibbonButton"

How to create a filter for my custom webpart toolpart


Hi All,

I have to create a filter for my custom webpart toolpart, similar to the filters in Content Query webpart toolpart.
What is the best way to get this achieved?


Custom filter - Looking in 2 fields


I'm using DD and VS 2010 in my application.

I have two dates (Start Time and PLN Start Time). In my filter, when the user choose a date, if the Start Time is null, I need to verify the PLN Start Time. Something like the code bellow:


        public DateTime StartTimeFilter
                if (this.StartTime.HasValue)
                    return Convert.ToDateTime(this.StartTime);
                    return Convert.ToDateTime(this.PLNStartTime);

How I can insert that column in my page filter ?

Custom Multi Filter Web Part for Report Viewer

I want to create a custom web part that has more than 1 filter web part and that can be connected to Report Viewer Web Part (Integrated Mode) at runt time/design time.

I searched a lot but could not find a way to have single web part that is a provider to more than 1 filters.
Say for example -
  1. My Report accept 2 parameter Department and Region. 
  2. I want to connect both parameter with single web part having two drop down (one for Department and one for Region)
  3. Values from both the drop down should be passed to Department and Region
  4. Report should be rendered in Report Viewer Web Part

Solution Tried so far
  1. Create a web part that adds two custom drop down
  2. Custom Drop down class that Implements from ITransformableFilterValues
  3. Have 2 Methods on the web pat each having ConnectionProvider Attribute and return instance of drop down control
  1. Even though 2 connection option is shown on my custom filter web part only one can be added
  2. For example - If I connect Filter1(custom web part) to Department then i am unable to connect to Report Viewer web part again.
My web part have methods like this 

custom field type works in view properties, but not in list view: 3 parent fields filter child list,


My situation:

A) odd thing is that no matter where I put a stop point in my custom field type, it is NEVER hit when the items are displayed in list view.  Event with <Field Name="CAMLRendering">TRUE</Field> which causes the list to error out, but again no stop point to help me know why.

B) the value of the column in question will be different for every user who views the list, I'm querying a secondary list based on the user's loginName, and two of the fields from the list we're in. 

C) the display is customized based on whether any records were returned and the current DateTime, so possible displays would be "", "! 12/1/2010", and "7/7/2011"

D) and the text displayed links over to a form for them to do their assignment. the link url would be a config setting url + "?[one of the fields form the list we're in]"

My questions:

1) Is it possible for fieldtype code to execute while a list view is being rendered?

2) If not, then should I chase down the path of a content query webpart?  Will it be able to filter on the current users login name?

3) If not on 1 or 2, can you think of any other way to do this beyond creating a custom application page? (need to having filtering and sorting on this page)

Custom Controls in C# .NET

Embedding user controls in a Windows form is just like adding a simple button or text box that are already provided with .NET. These basic controls were written essentially like you code your own controls. Typically the controls you design are to be used in multiple forms or to modularize your code. These reasons help reduce the amount of code you have to type as well as make it easier for you to change your implementation. There should almost never be any reason to duplicate code because it leaves a lot of room for bugs. So, implementing functionality specific to your control in the control's source code is a good idea. This reduces code duplication as well as modularize your code, which is a good programming guideline.

Writing custom MembershipProvider

ASP.NET Membership mechanism allows to use the build-in server tables to store and retrieve user data. By default, this mechanism can only be used with SQL Server database to which Microsoft provides suitable MembershipProvider class.
Inheriting from this abstract class, developer can use his own table(-es) from any database and use any database engine other than SQL Server, like Oracle, DB2 etc.

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:

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.

Custom Editing Behavior for DataGridView TextBox Columns

For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key
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