.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

Filter Parameters/Search Form

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


I've got a gridview that I need to perform filters on. All works great until I try and add a date range..

Below is the code. Basically I have 5 dropdown lists which all filter as expected giving them the option to use each one or just the ones they need.

The problem is they want to also have the option of filtering by date i.e date range or greater than or less than or equal to etc..

As soon as I add the date parameter it stops the other filters working. I'm guessing because I have a null value in the date field (textbox) if they dont use the option??

Does anyone have a sample on how to filter by dropdown lists and dates keeping in mind they wont use all the filter options?

Thanks for any help.

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
            width: 100%;
            width: 1

View Complete Post

More Related Resource Links

Filter search over multiple text columns


Hi everyone,

I'm working on a library that stores information on various cases. The case table has several columns that contain descriptive strings on what happened in the case. I would like to create a single filter that returns all cases where the search string is found in any of the columns. I've looked at Dynamic Data Filtering, but as far as I can tell, the "Contains" filter only allows you to connect to each column individually. Has anyone tried this?



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.

Issue in Infopath 2007 browser form - cascading dropdown using owssvr.dll filter view


Referring the below link, I created a cascading dropdown. The parent dropdown has sharepoint list as datasource and the child dropdown has xml datasource that points to owssvr.dll filter view. The cascading drop down works fine in preview but throws error after publishing as admin approved form - "form cannot run the specified query" exception when trying to execute xml datasource i.e., when a value is selected in parent dropdown. The security is 'Full Trust". In the event viewer the error message states "401 unauthorised" for the user a/c. the xml data source is an approved udcx file and in central admin, have enabled cross domain for infopath service. I have tried different solution provided in tech forums but issue still exists. Not sure whether Im missing something. Can someone guide me in fixing this issue?

Link Reffered:



Filter web parts in new form page of a list



I've created 2 custom lists. The 2nd list has a lookup column from the 1st list. In the new form page for this 2nd list, I've added the 1st list as a web part. Now, I want to connect the 2 web parts, but it's not available. Basically, what I wanted is that when I select an item on the lookup column, the webpart containing 1st list would show that item on the same page.

I think I'll need to use Sharepoint Designer to implement something like this, but just wanted to check if anyone has done something like this using browser only.



Filter People search

Is it possible to filter people searches?  For example, remove users with a certain last name?

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.

Form Action Button to pass parameters through URL and how to fill a NewForm with them

Hi I'm trying to solve a bigger problem we have in babysteps, and I guess after days of searching and trying I simply need to ask for help. The big picture is, that we're trying to put a Form Action Button (via Sharepoint Designer 2007) above a custom DataForm DispForm.aspx which is supposed to navigate to a NewForm.aspx where the Title Field is supposed to be prefilled with a parameter from the DispForm and the user should be able to add information to the item before it is saved. I found several explanations from people on the internet, but nothing really worked. The first babystep would be to get the parameter through the button into the url of the new item.   < input type = "button" value = "Zugriff Beantragen" name = "btnFormAction0" onclick = "javascript: {ddwrt:GenFireServerEvent('__redirect={../Zugriff Beantragen 2/NewForm2.aspx?test={ItemID}')}" />   That's the code for my button. Somebody wrote that should definitely work because SharePoint is able to replace {ItemID} with the actual ID of the item. Well.... it kind of doesn't. What I get as the end of the new URL is exactly "...?test={ItemID}"   I tried with different names for the ID, I added an @ before those ... no change. I read somewhere about javascript.functionName() which should work with all parameters of the item, but

How to form xsl for search results

Hello All I am having one content type which was used for page and in that having one site column with type of Choice (check box list with multiple selection) so using that user can select multiple items of that field on the edit mode of page. I have implemented search on that column. I display results in customized format using xsl. I display all the other fields with single line text as below and getting proper data in search result. <xsl:value-of select="@Hospital"/> but i its choice type then it displays like below and do not give the actual item seleted on the page. System.string[] Can anybody tell me how to form an xsl to display such fields so that i can get value as below . value1,value2..   Thanks & Regards Mrugank Dholakia

Filter Infopath Form View issue

Hi every body I want to Filter Infopath Form view based on the Document Library Name , or url . for example i have two document library : users and Moderators . I need if user open the form in users document library , the form opens with Users View and if user opens the form in Moderators document lib the form open with the Moderator view . what should i do ? I tried to insert a text box in my form and set it's default value to use sharepointlisturl function. but i think the sharepointlisturl function only use when the form hosted from the lists , not document libraries. when my form hosted from document library the text box is empty. i don't know what to do !

MS Filter pack for Zip files content search not working

I am facing a problem related to Zip files content search. Searching of content inside zip files doesn't return in search results. But searching for zip file name returns filename in search results. I look into Crawler log, all it says is:   Steps I followed to install MS Filter pack: Installed MS Filter Pack 1.0 (x64) http://support.microsoft.com/kb/946336/en-gb In Search Administration page added "zip" in File types Add Reg subkey under : "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\" for ".zip" with value ={20E823C2-62F3-4638-96BD-90F4F6784EBC} Stop and Start oSearch Run full crawl of content sources Can you please advise or have any tips you got to resolve this. Thanks http://portal/testzip.zip Crawled (The filtering process could not load the item. This is possibly caused by an unrecognized item format or item corruption. )

Custom advanced search form

Hi all, I've got some requirement which related with the advanced search form. I'll need to make a tree view which listed the site subsites and document library inside each site. For example:  sites A       DocLib 1       DocLib 2       subsites B              DocLib 3              DocLib 4       subsites C              DocLib 5              DocLib 6 Also I want to make the node which is selected as the scope for search. Is there any body can give a clue or pointer how I can make this? Any insight is appreciated.. Thank you Best regards, -- Pingkan --

BDC Picker only displays 200 items and the filter "search" does not filter or search!

What’s wrong? It doesn’t work like the people picker of filter by first few entries. The picker just seems to display the first 200 results in the database table but does acknowledge that there is more data! I am using the specific finder method - having created the Application Definition File using BDC MetaMan. Many thanks to anyone that can help. If you need further information to get more of an understanding - please do not hesitate to ask :-)

Why search do not work if I leave only 1-2 parameters to the Advanced Search Box?

I have add advanced search box to the SharePoint 2010 Server Enterprise portal. Default configuration works fine and I can also uncheck few parameters, but problem exists if only 1-3 parameters are checked and other parameters are unchecked. I would like to leave only "All of these words" and "Show Exact phrase" and remove the rest of parameters. However if I uncheck following, the search do nothing. SharePoint refresh the site, but do nothing. -Uncheck: Show "exact phrase" search box -Uncheck:Show "none of these words" search box -Uncheck:Show the scope picker -Uncheck:Etc.Kenny_I

Using parameters to search dates in Reporting Services


Hello there, I have recently started using SQL Server Reporting services. I currently have a problem.

I am trying to achieve a search by dates in a report.

I have a table with the fields RequestDate in e.g. 22-Jan-2010 or 23-Sep-2010

I have created a report in Query Designer with two parameters in it RequestDate & RequestDate2.
The Operators are for RequestDate is: Is more than or equal to
The value is: 1-Jan-2010

And the Operator for RequestDate2 is: Is less than or equal to.
The value is 30-Dec-2010

When i go to the SQL Statement this is produced:

  MHRA.RequestDate >= @RequestDate
  AND MHRA.RequestDate <= @RequestDate2


When i go to view report i want to be able to search for dates between the dates  1 Jan 2010 and 30-Aug-2010

My query seems to pick up all or most of the results between these dates.

How can i build this query so i can get specific results. For example...in the Request Date Parameter box i would put 2-feb-2010 and in Request Date 2 i would put in 5-Jun-2010 and this would return all the results between these dates.


using a session or form variable to force a filter on results


is it possible to force a filter on the auot-generated pages (list, listdetails, insert, edit, details) so that it only shows records relating to a particular Session variable value (e.g the logged-in user's id or form variable)

is this acheivable?



I want to filter the gridview on textchange in search textbox....


hi friends...
i want to filter the gridview on textchange in search textbox....
if i press "a" the gridview should filled up with record starting with "a". i have some code

SqlDataSource1.SelectCommand = "select * from DeptMaster where DeptName like '" + TextBox1.Text + "%'";
        SqlDataSource1.SelectCommandType = SqlDataSourceCommandType.Text;
        GridView1.DataSource = SqlDataSource1;

its working while leaving the textbox but i want this code should execute on keypress event....

Search Form Code Behind


I want to create an Select SQL string by some search fields. Since I can't check the blank ones, otherwize it would look for blank, I have to do this on steps, adding them if they where not in blank, so, for that I am using something like this:

String SearchString = "SELECT * FROM Sala ";
String SelectWhere = "WHERE "; //This where is because I may receive all empty, so, the WHERE would make problems in the string.

If (TextClassroom.Text != "") {
  SelectWhere += "(Classroom = " + Classroom.Text + ")";

But here is the issue. I may search for more than one at once, and that, would make me have to put an "AND" clause between them. How do I check that in the less number of lines as possible? I made a count variable, so I can count when it has been entered. But, getting to the third time it gets in, I have to check if the number is 1, or the number is 2, to see if I need to put an AND, right? And that would start making hard when we have, like, 10 fields. Is there an easier way to check when to put the AND without that many checks inside checks of empty texts?

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