Microsoft SharePoint Designer Team Blog

ASP.NET Controls Filter the Data View

John Hey there,

My name is John Jansen and I'm one of the Test Leads for the SharePoint Designer (SPD) product group. My specialty is data presentation and application building. But I also love to play around with CSS and generic ASP.NET controls. I plan to post tips and tricks here based on questions I see asked in Newsgroups as well as Discussion Boards inside Microsoft.

This first tip is about inserting an ASP.NET control onto a page in SharePoint Designer and then using that control as the mechanism for filtering a Data View on the page. For the purposes of this post, I'm using a DropDownList control because that seems to be the one most people ask about, but you could use a TextBox or CheckBox or anything else and get similar results. The scenario here is that you have a bunch of Categories and a bunch of Products that fit into those Categories, and you want to use a DropDownList to show Products for a specific Category.

To begin, create two lists in the browser: Categories with a field of CategoryName and Products with a field of CategoryName as well (I use a Lookup field type for simplicity, but it doesn't have to be - this code does a simple string compare). Then fill out the lists so you have more than one item in each.

This tip also assumes you already know how to open your Site in SPD and you have created a new page. I realize it is a lot of steps, but I believe they are pretty straight forward as you perform them...

  1. Place your page into design view
  2. Click Task panes :: Data Source Library
  3. Click the data source called Categories
  4. Click to Insert Data Source Control
  5. If prompted, click “Yes” to display the control
  6. Place insertion point below this control
  7. Click Insert :: ASP.NET Controls > Drop Down List
  8. Click the Smart Panel :: Choose Data Source...
  9. Choose the Data Source (for example, SPListDataSource1)
  10. Tell it to display "CategoryName" (or the field that contains your category name)
  11. Make its value "CategoryName"
  12. Click OK
  13. Click to select the dropdownlist control
  14. Click the Smart Panel :: AutoPostBack == True
  15. Drag and drop the Products list onto a page to create a Data View
  16. Clck the Smart Panel :: Edit Columns to add and remove the columns you want to display
  17. Click Data View :: Filter 
  18. Create the following filter:
                    Field: CategoryName (or the field that contains your category name)
                    Comparison: Equals
                    Value: [Create a new Parameter]
                                    Param Name: Param1
                                    Source: Control
                                    Control ID: DropDownList1
                                    Default: Beverages
  19. Click OK
  20. Click OK again
  21. Save the page
  22. Preview in the browser
  23. Make a change to the DropDownList control

OK. That should do it! Good luck.

-John

Published Monday, March 05, 2007 5:57 PM by spdblog

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Barry said:

Thanks for the tip. Have you looked at whether it is possible or if there are any issues with Ajax enabling this solution with the UpdatePanel?

Thanks,

Barry

March 7, 2007 11:38 AM
 

spdblog said:

AJAX here should be fine. You may notice that you can select the view of Products in SPD and click on Data View..Change Layout. Then click on the 'General' tab. In there we have a check box to enable sorting and grouping on column headers. That feature uses AJAX-y code.

March 9, 2007 10:45 AM
 

Barry said:

Glad to hear it. It would be nice not to pull back down the master page on a refresh within the UpdatePanel.

Barry

March 9, 2007 8:29 PM
 

Paul said:

How can i set a default value like "Please make an selection" ?

March 15, 2007 7:38 AM
 

spdblog said:

Yes. You need to set the properties on the dropdownlist control to do that.

1. Select the control

2. click on Task Panes > Tag Properties

3. change the AppendDataBoundItem to be True

4. Click the Smart Panel > Edit Items

5. click "Add"

6. type "Please make a selection" for the Text property

7. Click "OK"

That'll do it for you.

March 15, 2007 10:31 AM
 

Paul said:

Thanks John,

That does the trick. One other question: how can i use the asp.net control to control a listview webpart? I cannot create a new filter in a webpart, only choose from values.

Paul

March 21, 2007 12:15 PM
 

Adam said:

Hi, thanks for a fantastic article! Very helpful.

I have go this working with Dropdown, but can't get it working with either checkboxlist or radiobuttonlist....is there something special I need to do for those please? Thank you.

March 21, 2007 8:54 PM
 

Brian said:

Thanks John, your post is quite helpful as resources on Sharepoint Designer are almost non-existent.

Is there a way to filter the datasource of a second dropdown based on the choice from the first dropdown?  (list of states based on choice of country)

March 22, 2007 11:37 AM
 

spdblog said:

Sorry I didn't see these comments in time to respond one at a time...

1. Paul, you can't use this with ListViews because they don't take parameters in for filtering.

2. Adam, yeah, you need to code the ParameterBinding by hand, unfortunately. When you follow the above steps, you should have a <parameterbinding location="dropdownlistbox1" .../> tag in your page. You need to change that to this: <parameterbinding location="checkboxlist(checked)" .../> where 'checked' is the property on the control you want to evaluate.

3. Brian, undortunately, not OOTB in this release. You can do this via Javascript, though, if you search live.com for something like "onchange javascript filter drop down". Sorry I'm not more help on that one.

March 22, 2007 12:07 PM
 

charanmai said:

How to filter in a ListFormWebPart?

April 20, 2007 2:58 AM
 

youngbuffett said:

I thought other users might appreciate my solution the question I posed earlier about filtering a dropdown based on the selection from the first dropdown (list of states based on choice of country):

<asp:SqlDataSource...  SelectCommand="SELECT * FROM [States] where [Country] = @Country">

<SelectParameters>

<asp:controlparameter PropertyName="SelectedValue" Name="Country" ControlID="ddlCountry" />

</SelectParameters>

</asp:SqlDataSource>

April 20, 2007 12:03 PM
 

youngbuffett said:

John,

Could you clarify your response to Adam about filtering based on a checkbox?  I have not been able to get it to work.

When I follow your steps for filtering on the dropdown, the ParameterBinding looks like this:

<parameterbinding... location="Control(DropDownList1)" .../>  [note the Control(...)]

1.  Do we keep the Control(...) for the checkbox, or does it go away?

2.  Is 'checkboxlist' in your example the id of the checkbox list?  The reason I ask is that there is an <asp:checkboxlist> control.

I have tried the following variations without success:

<parameterbinding... location="chkID(Checked)" .../>

<parameterbinding... location="Control(chkID(Checked))" .../>

<parameterbinding... location="Checkbox(chkID)" .../>

Thanks, Brian

April 20, 2007 12:41 PM
 

youngbuffett said:

Here I go again providing a solution my own question.  I didn't have any luck with the ParameterBinding, so I replaced the WebPartPages:DataFormParameter (that was created when I added the filter) with an asp:ControlParameter.

<asp:SqlDataSource... SelectCommand="SELECT * FROM [Table] WHERE [BooleanColumn] = @Condition>

<SelectParameters>

<asp:ControlParameter Name="Condition" PropertyName="Checked" ControlID="chkTest" DefaultValue="False"/>

SelectParameters>

</asp:SqlDataSource>

Where 'chkTest' is the id of the checkbox on my page, and 'Condition' is the arbitrary name I gave the parameter.

Cheers, Brian

April 20, 2007 1:06 PM
 

spdblog said:

Sorry to leave you hanging like that. Your solution is excellent. My solution was typed incorrectly.

I meant to tell you to do this:

<ParameterBinding Name="Param1" Location="Control(CheckBox1,Checked)" DefaultValue="foo"/>

Which I just tested and verified it does work.

Sorry about the confusion.

-John

April 20, 2007 3:31 PM
 

JulesAnime said:

Great post - just what I needed. Is there a way to allow for "All Items" to be returned. I have added a default Item to the list and updated the AppendDataBound Items = "true". This gives me a dropdown with choices "All Items" and then my list of choices, but I want the defualt view "All Items" to return all itmes in the list and not filter them, and then for the user to be able to filter the results. Is this possible?

April 30, 2007 6:48 AM
 

Bob said:

Hi,

Is there a way to have distinct values in the dropdownlist?

April 30, 2007 11:36 AM
 

lsomers said:

I've used the SPD treeview control with success EXCEPT that, try as I might, I can not figure out how to change the font color and hover color of the linked nodes. I think I've changed every style on every style sheet and changed every NodeStyle parameter the TreeView has, yet the text remains blue.

Worse is that the colors do change in Sharepoint Designer but not when I view the font in IE.

Can you shed any light on this?

Thanks.

May 1, 2007 5:00 PM
 

Mat Imtiaz said:

I am trying to do the same thing, but my column in drop down list is it self a lookup filed. The values shows up as "1;#TEXT" with out quotes. Is there any way to work with this scenario?

Mat

May 9, 2007 4:26 AM
 

Marta said:

Hello !

I have the same proble that JulesAnime, wanted to be able to show all the records before being leaked(filtered) on having changed the value of the dropdownlist. There is way of putting a value for default type ' all items' ?

Excuseme , i don´t speak and wrote well in english.

Thanks

May 17, 2007 6:04 AM
 

spdblog said:

Yes, you can change the above scenario for "All" items to be shown as well, but it can't be done at the source layer, you need to modify the above to do the filter at the XSLT layer. First of all, add the value "(All)" without the quotes as the selected value in your DropDownList Control, then

1. Click in the Data View

2. Click on Data View > Filter

3. Delete the filter that is set there

4. Click OK

5. Switch to Code View

6. Find the line that says: <xsl:template name="dvt_1.body">

7. Add a line of code to that template just before the call template:

<xsl:if test="@CategoryName = $Param1 or $Param1 = '(All)'">

Your code will look like this:

<xsl:template name="dvt_1.body">

<xsl:param name="Rows"/>

<xsl:for-each select="$Rows">

<xsl:if test="@CategoryName = $Param1 or $Param1 = "'(All)'">

<xsl:call-template name="dvt_1.rowview"/>

</xsl:if>

</xsl:for-each>

</xsl:template>

8. Save the page

NOTE: Since this filter is now happening in the XSLT, you will see a performance hit. The amount of hit depends on the number of items in your source.

Good luck!

-John

May 17, 2007 11:44 AM
 

John Noel said:

I can do this for WSS 3.0 sites, but cannot for WSS 2.0 sites. :-(

The "Insert Data Source Control" option is grayed out for WSS 2.0. How would I do this in WSS 2.0 or I can't?

May 18, 2007 4:02 PM
 

Himani said:

How to add access database in sharep point designer?

May 23, 2007 5:47 AM
 

Scott Wilson said:

Just What I was lookinf for.. Thanks!

This link did the same for me on WSS 2.0 for those that are interested http://wss.collutions.com/Lists/FAQ/DispForm.aspx?ID=202

May 24, 2007 6:31 AM
 

Rasika said:

I have a question like this and i want to create a view based on those two

Say list1 and list2 - list1 is similary to category list, list2 similar to product list however list2 has lookup field for list1 but can include multiple values from list1 in that field, it's like product belongs to multiple categories (for a given product you can specify multiple categories)

now I want to have a view, that there's a list1 (category) drop down that you can select a category and then the products having that category should be listed below. (here this is many to many relationship) i tried using your way but it didn't work for me)

tell me on how to do this, and remember that product (list2) has lookup field for category( list1) where you can select multiple categories for single product

Thanks

June 7, 2007 11:27 PM
 

Balaji said:

How to do filter in a ListFormWebPart?

June 16, 2007 6:29 AM
 

crenter said:

June 25, 2007 9:02 PM
 

Steve said:

How do I access the element selected in the drop down list?

July 9, 2007 5:10 PM
 

chopper said:

 spdblog said:

Yes, you can change the above scenario for "All" items to be shown as well, but it can't be done at the source layer, you need to modify the above to do the filter at the XSLT layer. First of all, add the value "(All)" without the quotes as the selected value in your DropDownList Control, then

1. Click in the Data View

2. Click on Data View > Filter

3. Delete the filter that is set there

4. Click OK

5. Switch to Code View

6. Find the line that says: <xsl:template name="dvt_1.body">

7. Add a line of code to that template just before the call template:

<xsl:if test="@CategoryName = $Param1 or $Param1 = '(All)'">

Your code will look like this:

<xsl:template name="dvt_1.body">

<xsl:param name="Rows"/>

<xsl:for-each select="$Rows">

<xsl:if test="@CategoryName = $Param1 or $Param1 = "'(All)'">

<xsl:call-template name="dvt_1.rowview"/>

</xsl:if>

</xsl:for-each>

</xsl:template>

8. Save the page

NOTE: Since this filter is now happening in the XSLT, you will see a performance hit. The amount of hit depends on the number of items in your source.

Good luck!

-John

I did all of this and it does load the page with "ALL Items" but now when i select one of the items in the dropdown the postback occurs but returns no results. PLEASE HELP!!

July 12, 2007 6:33 PM
 

inspire said:

I've been working on filtering off of a drop down list using both the CAML queries generated by the Filter dialogue box and using XSLT at the call-template level.  While the most recent post on using XSLT does in fact filter everything correctly, it causes an issue with paging.  I have over 1500 pieces of data in the list that I am filtering.  The $Rows parameter holds every single row retrieved from the database.  This is also the variable used to signal when you've reached the limit for number of entries per page.  Because XSLT doesn't use variables in the modern sense of the word, the row counter cannot be decremented every time you skip over an element.  If I have my paging set at 100 items per page, this filter will always return 16 pages of information, even if some pages have no items that fit the filter criteria.  Each list item contains a picture that isdisplayed as a thumbnail on this same page, so showing all of the items on one page to bypass the paging issue is suicide for performance and is just too hard to look at when few values have been filtered out.  Any help is apprciated

July 16, 2007 2:28 PM
 

Sowmya said:

Hi,

I need an urgent help. I have an aspx page where i have 2 textboxes and 1 drop down list. I have a dataview for which the datasource is from a custom list- Assets. Also the drop down populates values from another list - Asset Type.

By default i want the dataview to display all items. Whenever i enter any filter criteria, i want the rows to get filtered. I have created 3 parameters - 2 for text boxes and 1 for drop down. Kindly advice how to proceed, b'coz when i gave % as the default value for these parameters i checked in the DB , when the query was executed the comparison was done - LIKE '%[%]%.

I am not able to remove the [] brackets. Please advice

Regards,

sowmya

July 17, 2007 12:40 AM
 

Nick said:

I follow the instruction in article, it works fine. But when I open "Data View Properties" and enable "SharePoint List Toolbar", it doesn't work, when you change drop-down list, the Data View always keeps same. So, how to fix this problem?

July 28, 2007 5:24 PM
 

Michael said:

Hey Chopper and to anyone else who had an issue with the All Items working but the other filter not, try the following:

1. Smart Panel -> Filter

2. Click "Add XSLT Filtering..." and then the Edit button

3. Add the above @CategoryName = $Param1 or $Param1 = '(All)' between the brackets.

This will get you to where you were in the step above, but without having to go into code.  I did this and had the same problem as you did.

Turns out, while you can change the column around, and such, sometimes designer doesn't update the column name.  For example, my column was currently named 'Category'.  However, originally my column was named Meeting Type.  Hence the variable was actually being used by my XSLT was: @Meeting_x0020_Type  

Now, you can dig through your code to find the correct name, or do the following: Once you are inside that XSLT filter window, the left window that is labeled "Select a field to insert".  Browse to your colum you wish to filter by and double click it to insert it.  It will show you the current name in the tree menu, but when you insert it it will give you the actual variable name.

Hope this helps!

August 14, 2007 5:41 PM
 

Michael said:

Quick update to my above post.  My environment is kind of wonky, so this may not apply to everyone else but:

If when you first go into the XSLT edit screen inside the SmartPanel -> Filter window, and you see the following tree structure on your left: dsQueryResponse->Rows->Row but then nothing below on rows do the following:  

After having checked "Add XSLT Filtering" from the Filter screen, save the aspx page again.  Designer doesn't seem to populate the XSLT object browser in the XSLT filter editor screen until the page has been saved with this enabled.

August 14, 2007 6:18 PM
 

Navid said:

I want  to choose the drop down list data source but when in Data Source Configuration Wizard in the first field I select SoapDataSource1 and then there's nothing happen !!!

( I'm using a Web Service as my DataSource )

only the 2 next fields become available but thers's nothing in them and I mean there's nothing to choose for TextField and Data Field !!!!

What should I do for DataTestField and DataValueField ??????

August 19, 2007 7:07 AM
 

Joel Snobohm said:

Can someone explain in more detail how one filter a dropdown based on the selection from the first dropdown. I have tried this tutorial at the top and got that working. But then youngbuffett came with a comment about my issue and I have NO idea on how to do this.. Any help would be great

As I said I have the basic tutorial working but i need this last bit to work. Help :-)

Contact me on drnibbles at gmail dot com

August 29, 2007 8:32 PM
 

Johnny Walker said:

What is the Parameter source and Property name that I need to use to filter by "[current user]" or "Context.User.Identity.Name" when using a SQLDataSource to populate a GridView in SharePoint Designer?  Please email me: sharepointer at gmail dot com

Thanks!

September 7, 2007 4:47 PM
 

donna said:

Is there a way to have distinct values in the drop down where the data source is referencing a sharepoint list?

September 10, 2007 3:22 PM
 

Derson said:

I am having the same problem as donna, I have this SPDatasource, that is actually a list, and I am using a specific colum that has duplicated values, it's possible to get read of them?

September 15, 2007 10:52 PM
 

MartyG said:

I am wondering how do I filter a data view based on a variable in the page.  Currently I have created a Page Layout based on a 'Partner Solution' Site Content Type which has the following Variables (Partner Name(lookup), Solution Name(lookup), description(htmp editor), partner logo(Image Editor), etc...)

When I create an instance of this page layout for each partner soltuion I want to be able to use the 'Partner Name (lookup)' from the assocated site content type to filter the data view.

I have tried using the control (as each of the columns in the site content type are defined as controls in the page layout) and system variable (cause control didnt work) and used the id as the vlaue but this still does'nt seem to work.

I then thought it might be something to do with the postback, wheather it was triggering a event after selection.

September 19, 2007 4:16 AM
 

Christian said:

Hi everybody!

Thanks for your awesome comments – I hope you have some awesome comments for my problem :)

I got a Website with a lot of dropdown Lists, which control 3 dataviews and all of them send their information via autopostback to the views. But everytime you choose an option in the dropdown, the postback going to work and send. ( The site actualizes itself. )

So how do I implement a button to postback manually, to save time and work from the server?

September 19, 2007 6:57 AM
 

Christian said:

Hi all

I solved my problem and need no help anymore - for now ;)

So for you the information:

button > properties > behaviour > potbackurl

here you have to fill in the url of the site you want to post to.

September 19, 2007 8:13 AM
 

Neha said:

Hi everybody

This blog is really awesome and has solved most of my queries regarding dropdowns and filtering.

But I am just wondering as to how a button can be implemented to solve the above problem of multiple postbacks for multiple dropdowns on page as asked by Christian

And on top of that - Would be really great if I can get an answer to this :)

How can i get all the filter criterias (like from RadioButtonList1, DropDownList1, DropDownList2, DropDownList3, TextBox etc ) on one page submitted to server on click of lets say 'Search' button ?

And results of these search criteria displayed on another ASPX page like 'SearchResults.ASPX' with data in grid form or listview form etc.

September 20, 2007 1:10 AM
 

Christian said:

I solved my problem!

go to the propertiey of your button an you will see "postbackurl" in behaviour. there you simply have to add the url u want to post to and finish!

the second question is tsimple: just add the url of your searchresults in the postbackurl from the button.

September 20, 2007 7:41 AM
 

Christian said:

I solved my problem!

go to the propertiey of your button an you will see "postbackurl" in behaviour. there you simply have to add the url u want to post to and finish!

the second question is tsimple: just add the url of your searchresults in the postbackurl from the button.

September 20, 2007 8:02 AM
 

Stephen said:

I've been having difficutly with parameter bindings on a 64bit system.  The same page works differently on 32 and 64 bit MOSS systems.

The binding:

<ParameterBinding Name="Surname" Location="Control(Surname)" DefaultValue="%"/>

or

<ParameterBinding Name="Surname" Location="Control(Surname,Text)" DefaultValue="%"/>

seems to be returning the TextMode property value (SingleLine or MultiLine) rather than the value of the text in the text box on the 64 bit system.

Is this a known problem, has anybody else experienced it and are there any workarounds?

Thanks.

September 28, 2007 9:54 AM
 

Robert said:

Preview error:

I can manage in SHD steps 1-21 according to the description and it shows data in design mode but when I try to Preview in the browser  it writes:

An unexpected error has occurred.

Troubleshoot issues with Windows SharePoint Services.

Where could be a problem?

Other aspx pages (NewForm.aspx etc.) are ok.

October 1, 2007 2:40 AM
 

Stephen said:

Robert, to get MOSS errors edit the web.config:

Set CallStack to true in SafeMode <SafeMode MaxControls="200" CallStack="true"...

Turn off custom errors <customErrors mode="Off" />

Note: it is recommended you only do this on test/dev systems

October 2, 2007 4:45 AM
 

Shankar said:

Hi,

I got a question. I would like to filter my DataView with a Text box, which I got it working (kind of). However the text should be case sensitive, in other words if I query in something that does not have the same case, i don't get any results.

Any help would be appreciated.

Thanks,

Shankar.

October 8, 2007 2:18 PM
 

Jan said:

Shankar, can you share your text box solution with me/us?

I have the following - but its not working:

<ParameterBinding Name="Param1" Location="Control(TextBox1,Text)" DefaultValue=""/>

When I provide a DefaultValue, SPD displays the correct filter result. But on the web page no results show up.

This is my text box control:

<asp:TextBox runat="server" id="TextBox1" AutoPostBack="True"></asp:TextBox>

The only control I get to work is the DropDownList.

Thanks!

October 12, 2007 12:53 PM
 

Jan said:

ok, it looks like it needed a IISRESET or so. the above solution is working with textbox.

Jan

October 14, 2007 6:29 AM
 

Dan said:

Is there a way to list only distinct values within a DropDownList using a SP list for the Datasource?

October 16, 2007 1:53 PM
 

ribru said:

Hi there,

i have a problem. I tried to filter a data view with a drop down list. Ive done like stated above but it wont work. I dont understand why. Has somebody a tip for me?

October 23, 2007 3:35 AM
 

ribru said:

<xsl:param name="FilePath" />

<xsl:param name="Param1">Vista</xsl:param>

...

<xsl:variable name="Rows" select="/table/data/row[contains(normalize-space(col [ 6 ] ), $Param1)]"/>

Here some code from me. If the default value of the drop down list is vista the filter works but whatever i select in the drop down list the page reloads and the data view is filtered with vista.

October 23, 2007 3:51 AM
 

ribru said:

Hi,

if i use only SharePoint Lists like in this article it works. I use a xml data source and i think this is the problem. Somebody an idea?

October 24, 2007 2:54 AM
 

John said:

Is there any way to make the filter optional?  Meaning is there any way to allow the user to see all rows in the list?

October 26, 2007 2:20 PM
 

ribru said:

Hi,

look @ July 28, 2007 5:24 PM

1. Smart Panel -> Filter

2. Click "Add XSLT Filtering..." and then the Edit button

3. Add the above @CategoryName = $Param1 or $Param1 = '(All)' between the brackets.

You can define 'All' as default. Works fine for me!

-----------------------------------------------------

My Problem still remains unsolved. How can i filter XML datasources? With Lists its no Problem but XML data sources it wont work. Only the default filter shows up.

Hope some DEV has an idea.

bye Richard

October 30, 2007 9:07 AM
 

Mike said:

Hello there,

I've this problem that I just can't seem to resolve:

I put a control with an sqldatasource just like this:

<asp:SqlDataSource runat="server" id="Interlocuteur" ConnectionString="blabla" ProviderName="System.Data.Odbc" SelectCommand="SELECT * FROM Annuary WHERE  Annuary.SocietyName=@newparameter">

<SelectParameters>

<asp:controlparameter Name="newparameter" ControlID="TextBox1" Type="String" DefaultValue="k"/>

</SelectParameters>

</asp:SqlDataSource>

but I get an error on my page, it doesn't seem to know the value of my Control

October 31, 2007 7:02 AM
 

MichaelSPD said:

Hi my sqlDataSource with the code like this:

<asp:SqlDataSource...  SelectCommand="SELECT * FROM [States] where [Country] = @Country">

<SelectParameters>

<asp:controlparameter PropertyName="SelectedValue" Name="Country" ControlID="ddlCountry" />

</SelectParameters>

</asp:SqlDataSource>

doesn' t seem to work with Sharepoint, the control doesn't have any value

October 31, 2007 7:23 AM
 

Sergio said:

Hi,

I'm trying to filter a Data View, which i have place in a DispForm, with a sharepoint control  (SharePoint:ListItemProperty). I have created the paramenter with this control, but it doesn't works. Why? Any idea?

thanks,

November 6, 2007 1:00 PM
 

Ovi said:

I have a SQLDataSource that I need to pass the current user name to in order to filter the data.  Can someone suggest a solution?

November 8, 2007 4:54 PM
 

Kevin said:

Is it possible to use this ASP dropdown on a Custom List Form in Sharepoint?  I created a new Form that works fine when I click New on the wss calendar, but when I try to the asp dropdownlist, I get an "unexpected error".

Any thoughts?

November 21, 2007 1:59 PM
 

McGraw said:

I have a sql view data source on a page and I've also added a date filter.  My data source has begin and end date columns.  I'd like to be able to select and date from the date filter and have all rows displayed where the date selected is between the begin and end date.  Can the value from the date filter be accessed by the data source filter using a parameter? I haven't been able to make this work.  Any suggestion would be appreciated.  

November 28, 2007 9:44 AM
 

Dave said:

new to SP designer, filling in for the programmer (who was fired)... I followed the instructions down to step 18.

Per the instructions, I created 2 lists and a new page, opened it up in SP Designer, inserted data controls for "Categories" and ASP.Net Drop down, I chose the data source using SPListDataSource1 and selected "CategoryName" for the other 2 fields, set Postback = True, drug and dropped Products list onto the page.  Once there I edited the colums and clicked on Data View::Filter.

Now the issue...... I selected CategoryName for the field, Equals for the Comparison and creted a new parameter called Param1, set to control but my Control ID field is blank.  I cannot select DropDownList1.  What did I do wrong?

Thanks;

Dave

December 20, 2007 5:31 PM
 

Sunil said:

Hi

I am able to filter with a dropdownlist and tried using the checkbox list by using your suggestion.

i.e <ParameterBinding Name="Param1" Location="Control(CheckBox1,Checked)" DefaultValue="foo"/>

If I am giving some defualt vaule, then its filtering based on that value. but if I select anything else, its not wokring.

Any help whould be highly appreciated.

January 16, 2008 4:54 PM
 

Dave number 2 said:

Hi, great post!!

Of course its not working exactly as planned...

I have two drop-downs filtering one list - it works fine with this xslt filter:

[(@Category = $Param1 or $Param1 = '(All Categories)') and (@Community = $Param2 or $Param2 = '(All Communities)')]

HOWEVER, when the page is FIRST loaded, the default results aren't shown - it is blank. I guess I could solve this by loading the page and automatically posting back, but this obviously isn't a good idea.

Is there any way to have the results of the filter be shown on the page when it first loads?

Thanks!

January 23, 2008 12:28 PM
 

Dave number 2 said:

Okay, I answered my own question, sort of, I have a work around anyways.

In addition to what I did as explained above, I also did what the poster said on March 15, 2007 7:38 AM. I appended an item called "-- Please select a value --" but in the VALUE field put in the '(All Communities)'. Seems to work, now when the page loads I still have all of the default values showing up.

Dave #2

January 25, 2008 4:05 PM
 

Nick Eales said:

All of this doesn't work as soon as you use a wss 3.0 masterpage. It works fine in an empty aspx page.

With the masterpage the parameter is always set to default and never picks up the actual selected value of the formfield.

January 31, 2008 3:51 AM
 

Alana said:

Hi,

This is a cool post.

I'm trying to sort the drop down list in alpha order. However, whenever I do this my data source gets the following error: Duplicate Component Name 'spdatasource5'. Component names must be unique and case-sensitive.

Anyone got any clue why this would be happening?

January 31, 2008 10:05 PM
 

Deb S. said:

Hi Jon,

I have reviewed your Demo's six part series.  I thought they were very helpful.  Thank you.

I just started working with SharePoint.  I have bought books on sharepoint and browsed ther internet for information.  I have some ASP.Net experience.

Two things I need to do right a way is design a great looking master page using a team template and the other is to allow internal company users and unkown users to our SharePoint site perhaps using Forms authentication, login/register.  I'm not sure if I'm going to use SQL server asp provider.

Can you point me in the right direction on these two items?.  Any videos on them?  

Thank you.

February 1, 2008 10:25 AM
 

Kevin said:

Hi John,

        Can we use a similar approach to filter a datasource inside a DataFormWebPart ? Let me give you the scenario, I've got a department list and a section list on my Site. I want to customize the newform of another list to be able to add Cascading DropDown Functionality for selecting a section ( Department->Section) as follows:

1. Created a datasource (1) to pickup all departments ( Note that Department Field does not exist in my actual list, only Section Field )

2. Connected an ASP.Net Dropdownlist to the Datasource (DropDownList1) with AutoPostBack

3. Create another datasource (2) to pickup the sections - Here I inserted {DepartmentName} as parameter in the CAML Query of the Select Method

4. Linked the Parameter using ASP:ControlParameter to the DropDownList1.

5. Added a Sharepoint:DataViewDropDownList, linked to the Section Field of the actual list and also linked to datasource (2)

Issues:

On opening the form, the list of departments and sections are filled correctly. When selecting another department, postback is performed but the section list does not get refreshed. Is there a fundamental thing I've missed out or this kind of implementation not possible ?

Thank you

February 3, 2008 8:53 AM
 

Mark said:

Is there any way to use the following field as input for the filter?

<SharePointWebControls:TextField FieldName="Company"  runat="server" id="TextField1"></SharePointWebControls:TextField>

We tried to do the same trick with  Control(TextField1,Text) but this isn't working.

Regards,

Mark

February 20, 2008 5:04 AM
 

Sean said:

Hi

Tried the dropdown dataview filter instructions and it worked perfectly

I have now set it up to filter on the modified by Field

I get some strange results in the drop down that includes the the persons name , email etc

eg. 37;#Sean ,#xxxx\yyyyyyy,#xxxxxxx@yyyyyyy.biz,#,#Sean

The x's and y's I used to replace the original data

How can I get it to display only the persons name

Thanks in advance

Regards

Sean

March 4, 2008 9:32 AM
 

gbelzile said:

Hi,

The drop down filter is not quite working for me.  It seems like it only work when the page is a postback.  I can't get the default value to work.  When I first load the page, I don't see anything.  Then when I change the value of the dropdown, I see my item filtered correctly.

Any idea?

Thanks,

gbelzile

March 5, 2008 4:14 PM
 

krystie said:

Hi John,

This post was really helpful - thank-you! I'm having a problem though, when the column I use in my drop-down list is a calculated column. My formula in the calculated column is: =TEXT(Date,"yyyy") so that I can see the Year of an entry from the Date column. However, when I preview the page in my browser, the years show up in the drop-down box as 'string;#2008' etc. Do you have ideas about how I can get it to just display the years properly?

Thanks, Krystie

March 15, 2008 7:57 PM
 

RonieR said:

Has anyone figured out how to get the select all feature to work yet?

March 24, 2008 1:37 PM
 

DeeDee said:

Hello everyone,

Try as I might, I can not figure out how to change the font color on the Quick Launch menu on the left-hand side of the site. I've successfully changed the font color in the .css code and made sure it was so when I right-click the quick lauch area to modify the style (to the color white that I want it to be instead of that default blue);the text color do change in Sharepoint Designer but not when I view the font in IE- it remains blue.

Would anyone be able to shed any light on this?

Thanks

March 26, 2008 1:48 PM
 

Panagiotis Kanavos said:

Regarding Nick's post about the Toolbar bug on July 28, the DataFormWebPart does not pass the parameter values to the CAML query when the "Sharepoint List Template" option is selected. You can solve this easily though, by copying the code generated by that option outside the DataFormWebPart. Just move all the code contained in the table starting with <table class="ms-menutoolbar" ... .

There is another bug that I have noticed with SPD. Adding filters to the DataFormWebPart breaks folders. Even when you navigate to a folder using the Treeview, the DFWP only shows the root folder. This happens because SPD removes the RootFolder QueryStringParameter from the SelectParameters of the DFWP's datasource. Just add the missing line, <asp:QueryStringParameter Type="String" Name="RootFolder" QueryStringField="RootFolder"></asp:QueryStringParameter>, to the SelectParameters.

Finally, there are problems when creating a list template that includes a view that only creates a DFWP. When a new list is created using this template, the DFWP is replaced by a ListView web part. To overcome this, add a hidden ListView web part to the view.

March 27, 2008 7:52 AM
 

shivamoss said:

HI..

i need help i am working on the look and feel of the page using sharepoint designer

what i have done is i have copied a default theme(verdant)and made changes to the

Cust1011-65001.css and replace the content of "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES\CustomBrown\theme.css

the changes are seen when the changes are made but when i replace the content of "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES\CustomBrown\theme.css

and when perform the application pool recycle of that web application and when i opened the Cust1011-65001.css file the number of lines of code got increased by itself and copy of ms-pagetitle was not changing and had a default color # eaffbc was seen  with the default  url of the image even after mnaking the changes again and again the same thing is getting repeated

please help

shiva.....

April 7, 2008 9:00 AM
 

shivamoss said:

John Jansen hope you are doing great

i am new to this .....i have 2 issues the one which i just posted and another is that the client is asking me to change the color of the text to black color which is on the side and global  navigation

so please tell (guide) me where shoule i do that and how

Regards,

Shiva

April 7, 2008 9:27 AM
 

LISpeedyG said:

Hi,

I am having a problem on the "Receiver" DataFormWebPart (DFWP) on postback when the "Provider" DFWP retuns a Null.

The above connections are made using a filter from the Provider to the Receiver.  A text box is used to filter the Provider DFWP using a "Contains" query.  And, on occasion, if the user inputs data that is not found the Provider DFWP does not return any records.  However, the Receiver DFWP returns the previous data rather than a Null.

Is there a step that I am missing to initialize the Receiver prior to each request?

Thanks for the help

April 7, 2008 9:46 AM
 

Balaji said:

Can u please guide me how to set the filter using a Textbox with a Button

April 8, 2008 4:10 AM
 

AFAWZI said:

Hi all,  i connected a form web part with checkboxes with List web part in Data View web part, this web part is uesd to display the username and the number of checks that user checking from the form, so when user X checks 3 checkboxes , the list will display the username X with the number of choices which is 3. The problem is when user X is loged in again, and checks another 2 choices, i wanted the list to display the user X with 5  choices (by adding 3 + 2) once. but what i get is that it displays user X twice, the first one with 3, and the second one with 5, what i need is to get distinct data in the list. any one can help, please i need to solve this issue as soon as possible :(

April 11, 2008 5:55 PM
 

John said:

Is there anyway to filter useing a date from a datepicker instead of a drop down?

April 19, 2008 6:36 AM
 

BING said:

Hi all, need help to set a filter with Textbox and DatePicker here. Only combobox work on my site.

Thanks for the help

April 22, 2008 5:25 AM
 

Desi said:

I am using a calculated column as a source and what I get is string;# before the value. Is there any way to make this disappear?

April 22, 2008 3:03 PM
 

Raman Deep Kasnia said:

Hi,

I want to display assigned task of currently logged in user while entering time entry in timesheet.

In "Tasks Worked On" field, i can see all users tasks, i want to do with share point designer, i m trying to do it from last 10 days, please help...........

April 23, 2008 3:43 AM
 

DarthVader said:

John,

Thanks for the post- as a SharePoint newbie you just saved me a bunch of time getting to my document library in a nice way. Really appreciate it!

I'd like to display a list of documents, like my document library, but with checkboxes at the left. User selects one or more items, presses a button, and I perform an action on each selected item in turn. For example, you could select a dozen items and kick off a workflow for each one using this UI. I have ideas about it, but would love to hear how you'd do it.

Thanks,

da

April 25, 2008 4:29 PM
 

spdblog said:

Hey Darth,

Unfortunately, that is not as easy as it sounds. I wrote some jscript to do that once, but it was pretty buggy due to the dynamic nature of the view. In mine, I inserted the checkbox, then converted the Title of a document in the view into an asp:Label control. Then I wrote script that said "for each checkbox, grab the innerText of the next table cell and do something cool".

Not great.

Someone else who visits here may have a super creative way of doing it, but I haven't really had time to nail one down yet.

-John

April 25, 2008 6:19 PM
 

spdblog said:

To John up above, about the DateTime question. Yeah, you create the parameter the same way, but change it so that it passed the SelectedDate attribute on the control:

<ParameterBinding Name="Param1" Location="Control(DateTimeControl1,SelectedDate)" DefaultValue="foo"/>

-John

April 25, 2008 6:20 PM
 

Roennow said:

Hi,

How do I make this scenario work i SPD:

1) Calculating a Year based on current date (ex: current date between 8/1/2007-12/31/2007 -> 2007, current date between 1/1/2008-7/31/2008 -> 2008)

2) Data Source Control referencing a SharePoint List (with field representing Year)

3) RadioButton list exposing values (from another field in the SP List) filteret by calculated Year

Can anyone help ?

April 28, 2008 2:33 PM
 

Panagiotis Kanavos said:

To John and spdblog about passing a date as a parameter.

Unfortunately, it's not that easy. The SPDateTimePicker control returns the date as a US-formatted string, causing the CAML query to fail. I solved this by creating my own date time control that inherited from SPDateTimePicker and added a SelectedValueISO property that returned the date formatted in ISO format.

May 9, 2008 9:01 AM
 

AnandhRaj said:

For Dropdown list filter in dataview

just have a try with this

First add the item as  All in dropdownlist and

initally in dataview - > rclick ->parameter

new parameter let say param1

select  source -> control

control id -> urdropdownlist

dataview -> rclick

filter->add xslt fil -> edit

it shows [ ]

after [ if u press u ll be getting list of fields there select ur field

for example  consider the field as deptID

so it should be like this

[@deptID = $param1 or $param1 = 'All' ]

bye

May 23, 2008 8:46 AM
 

AnandhRaj said:

For Filter through drop down list

dont forget to set the property of dropdown list

ie

AppendDatabounditems   to true

May 23, 2008 9:20 AM
 

Jarrod said:

I am new to all of this and need a little help, I have created my custom list and have the page with drowns the way i want it, what do I need to do from there, I have already gone to the NewForm and gon to the main master and replaced it with a custom list so I can see everything in designer, I just need to know how to setup some colums for the drop downs how to link the drops downs..... well everything with kid gloves.

May 29, 2008 1:22 PM
 

David said:

Has anyone managed to get the 'view all items working' as everytime I try this the filter stops working?

Anyway got any tips?

Thanks

June 2, 2008 6:48 AM
 

Deepthi said:

Hai,

I have used this for displaying my list of projects in a dropdown in Newform of Contacts list. It worked fine. But now I want to see the value which has been selected in the dropdownlist displayed in the dispform as well as in the edit page the value which has been selected while creation and saved has to be selected. And upodation should also be done when edited.

Can anyone help me please?

Thanks

June 6, 2008 9:21 AM
 

Tim said:

Hi, this was a great post, thatnks. Did anyone manage to get the suggestion youngbuffett made on filtering based on the results of a dropdown going? Like everyone, searching for a resonable solution to problem described where you pick a State based on a Country selection.

Thanks a lot

Tim

July 20, 2008 2:09 AM
 

Clare Selley said:

I'm having trouble with paging. I've got a nice drop-down box working (autofilled from a SQL database) and filtering an SQL datasource. However when I go though to, say, record 21-30 and then select another selection from the drop down box, the records still start at 21-30 and I have to click 'start' on the paging to get me back to 1-10.

Any idea how to tell it to filter & set the view to 1-10 when the selection is made?

Thanks!

July 23, 2008 11:34 AM
 

Rithwik said:

Hello John,

I have a filter where in the based on the user profile the page gets displayed.

One of the filter has 'R&M' as the text. the filter does not work with the '&' When i change the filter condition to 'RandM' it works.

Could  you please help.

July 24, 2008 10:59 AM
 

Patrick said:

Hi,

For those of you having trouble binding a parameter to an asp TextBox <asp:TextBox runat="server" id="TextBox1" AutoPostBack="true">, I don't think any comments have addressed this, so I am going to post.

To bind a parameter to a textbox everyone was trying to use

<ParameterBinding Name="Param2" Location="Control(TextBox1,Text)" DefaultValue=""/>, but this will just return the TextMode when trying to use $Param2.  

Instead set the location to Form(TextBox1)

<ParameterBinding Name="Param2" Location="Form(TextBox1)" DefaultValue=""/>

Now $Param2 will give the value in TextBox1 !

August 12, 2008 7:40 PM
 

Spandana said:

Hi,

We have a dataview webpart along with a filter(dropdown) associated with it.. we are facing a strange problem. once we select the value from the filter the data is getting populated in the dataview webpart however the value selected is not getting retained. please let us know the fix for this.

Thanks in advance

August 19, 2008 5:41 AM
 

abinjaik said:

Hello Friend,

                 My problem is regarding editing the Newform.aspx of my list. What i need is  to  autopopulate/autoselect  a dropdownlist according to a selected value in another dropdown. I will explain in detail. I do have a list that contains TaskId and TaskDescription.

Say Like T100 taskid corresponds to a task description "Collect Details from a customer", T200 taskid corresponds  to a taskdescription "get Feedback from Customer B".. Likewise.    And i do have another list which have 2 dropdowns Taskid and TaskDescription. What i need is to Autoselect a taskDescription item in TaskDesription Dropdown according to the selected TaskId. Only This change i need to have in Newform.aspx of my sharepoint List.How can i .... Plz help me up...

August 22, 2008 1:54 AM
 

CCML01 said:

Trouble with binding a parameter to a textbox:

<ParameterBinding Name="Param2" Location="Control(TextBox1,Text)" DefaultValue=""/> -> Does not work (in fact, works sometimes, depending mostly on IIS Reset... Works for a while, then stops, then works again after IIS Reset...) BUT ...

<ParameterBinding Name="Param2" Location="Form(TextBox1)" DefaultValue=""/> -> Does not work at all (at least here) !

That's very nasty, because I urgently need this kind of filtering !

Any idea ?

Thanks

September 3, 2008 9:15 AM
 

Paul K. said:

Ok John,

you have taught me a good amount of development in Designer. I subscibed to your Total Training Videos and have two question that are very important.

you do thie example above with a Dropdown list. I need to do it with a Textbox. You have this on the video training, but when following exactly my filter doesn't return anything after postback?

and Second: what is the best way to form (data) validate? I can't find a tutorial, if you could point me in the right direction.

thank you in advance,

Paul

September 4, 2008 9:18 AM
 

Noel said:

Hi John!

Good Day!

I have read from this post that at lot of people are also experiencing the same problem i have, on how to pass the current user name to an SQL Data Source as a parameter.

I hope you can share, or anyone from this post, some solutions to it.

Thanks a lot!

Regards,

Noel

September 10, 2008 9:14 AM
 

serguei said:

Hi,

I´m trying to filter a data view based on a textbox input (using "contains" comparison), how can get it?

September 10, 2008 11:38 PM
 

Graham said:

Not sure a solution was posted to the issue of TextMode being returned from the asp:textbox control when used as a ParameterBinding control.

The Location=(Control) is expecting a "Value" property.  Putting Location=(Control, Text) you think would fix it and i've seen it work, but not consistently, So I wrote a quickly extension of the textbox class with a Value Property...  Works great...

------------------------------------------------------

Imports System.Web

Imports System.Web.UI

Public Class TextBoxWithValue

   Inherits System.Web.UI.WebControls.TextBox

   Public ReadOnly Property Value() As String

       Get

           Return Me.Text

       End Get

   End Property

End Class

September 14, 2008 9:01 PM
 

spdblog said:

I apologize for my lack or response here. Yes, it turns out that the Textbox control has an issue because it passes its properties to the page in an arbitrary manner. That is: this fails when the TextMode property is passed in before the Text property. Since the order is arbitrary, an IISRESET will sometimes correct it and then another IISRESET will break it again. I have been working on a way to get this working consistently, but as yet have come up empty.

As for validation, I simply put an asp validation control on the page (from the toolbox) and use that. You can't use it with FormField controls, but if you convert the FormField into a TextBox, then you can.

HTH

-John

September 17, 2008 10:43 AM
 

Ram said:

Hi john

Very effective document

but i am stuck on some issue,actually i want to create a archive of news

and i m picking the data from share point list named news1

how can i do this ,i need your great support to solve this, please help me other i will miss my project deadline.

Actually  in my share point list i have columns "newsmonth" and "newsyear". and i have to pick up the news corrosponding to these columns.

Please help me

regards

ram.sharma121@hotmail.com

Thank you

September 19, 2008 10:11 AM
 

sharavathi said:

Hi,

I am trying for multiple filter option.

I have taken a simple form webpart, which contains multiple checkboxes.

and i have a dataform webpart to apply filter criteria and search the result based on checkboxes selected from form web part.

I have written some javascript code to appy the condition and submit the for to url.I am passing parameter through url. I am facing problem to display all the items if no parameters are selected.

Please help me.

thanks,

sharavathi

September 24, 2008 4:54 AM
 

Bobby Vastakis said:

Hi all,

Great blog.  Many of the comments have to do with a drop down filter pertaining to a data view.  Can I perform/set up a similar paramater for formview.

I have two tables (employee and interview).  I want to have a drop down list that displays the employee names and shows the corresponding records from the interview table.  I want the ability to edit/insert/update/delete records from the interview table as this time.

Thanks,

Bobby

October 21, 2008 8:19 AM
 

James McDowell said:

I am having the same problem as ribru above.  I can get this to work great on list and Web service datasources but NOT on xml data sources.

Please help.

James

November 10, 2008 9:03 PM
 

Uzma said:

Thank you! It's just what I was looking for an event listing for my company!! Many thanks.

November 20, 2008 7:43 AM
 

raj said:

Hi..

every one in this blog are doing a great job. especially my thanks to John Jansen and other guys who are solving our queries.

I had a problem in geting solution for the requirement: Where i am having a data view from cross lists and lists are considering from subsites of a site and with same content type.

the problem here is..I want to provide a linkable/clickable column on the data view, where on click of it should redirect to that list item edit view or else to the site where the clicked item list exists(means parent site of that list item).

Please can any one solve my requirement.

I hope i am clear with the query.

Regards

Raj

December 23, 2008 7:19 AM
 

nh said:

Hello,

Similar to the problem Inspire had faced, i am also working on the filtering off of a drop down list

It  does filter correctly but it causes an issue with paging.

If there are about 1000 rows. The $Rows parameter holds every single row retrieved from the database.  

Suppose there are just 50 items matching our filter. Still it returns all the pages with blank items.

i dont know how to stop it and sort it so that only the filtered rows are shown.

Please help.

February 2, 2009 10:56 AM
 

Shashank said:

Hi John

I am new to share point

In my page I have 2 web parts with list Items.

Web Part1 will have Selected Items

Web Part2 will have un selected Items based on field "Selected"

Item Name        Selected

1                        Yes

2                        Yes

Item Name        Selected

3                        No

4                        No

In my web part  have to show a column "Selected" with drop down list with Yes/No Values.

When users changes the values it should go to corresponding web part

my requirement is I have show drop down list in selected column.

when yours selects different value it should go to corresponding web part.

Regards

Shashank

February 23, 2009 6:57 AM
 

Vinay said:

Hello all,

I have a doubt, when i apply filter to didplay data according to dropdownlist value, i want to see complete table intially then it has to filter acording to the dropdownlist value, can any one help in this.

March 11, 2009 12:51 AM
 

fk said:

Thanks for the great article. However I am faced with the same issue, textbox control filter behaving unpredictably. Sometimes though an iis reset fixes the issue.

Did any one figure out a solution for this?

Thanks in advance

March 11, 2009 12:17 PM
 

Netta said:

I’m trying to filter a list using multiple drop down menus : currency, dimensions and file type.

I used the "AutopostBack and controls" method to build the filters.

But now I got a problem.  what I need is to be able to get results immediately after each filter is chosen,  and not have to always choose all 3 filters.(the way it works when using the SharePoint filter web parts)

That is, If I choose dollar in currency filter I want to get all the “dollar” items, then if I add file type  : jpg I want to see the ones that have dollar and are jpgs.

I can’t seem to get it right.

If I choose “and” in the data view filter – I don’t get any results till I choose all 3 filters

If I choose “or” I end up with all the items that are “Dollar” and also all the “jpgs” instead of items that are “dollar & jpg”.

I’m sure there must be a way to get it working.. any ideas ?

March 18, 2009 5:26 AM
 

contoisd said:

I have tried to filter dataformwebpart using a dropdown list as per instructions in this post, however I have not been sucessfull.  My dropdown is a lookp from a sql query from our EPR system (ie Project Number).  I want to filter my document library to only show documents from the Project Number in the drop down list.  

Here are the steps:

1) insert asp.net dropdown, insert datasource (sql query from erp system)

2) set data field and data text field, autopost back

3) insert sp doc library as dataview

4) filter dataview with new param1 from control dropdownlist1

When viewing the page, the document library is not filtered and returns nothing.

I've searched everywhere to find how to bind a asp.net dropdown to a sp list of doc library and have had not luck.

Thank you for your help.

Dan

March 25, 2009 9:55 AM
 

contoisd said:

With respect to my post on asp.net dropdown not filtering,  the filtering works when I use the document library as the datasource for the dropdown, however when I use a sql query for lookup for the dropdown list, the filtering does not work.

March 25, 2009 11:26 AM
 

chewbanda said:

HI Im a new comer for this site. I have one questions.

I need to create a drop down list on the page and based on that i need to filter a multiple look up. as a example if i select categary1 in the drop down list it should populate the lookup column with the filtered data. Can we do that??

Thanks

April 1, 2009 6:19 AM
 

Gezmo said:

Hi thanks for greate article, for me I could filter the data using both specified value or All from the dropdown list control but I found difficulty to use the approach with grouping option in the dataview.

Where exactly to place the condition to let the filtering working correctly if we have grouping option in the view.

Thanks,

April 21, 2009 6:25 AM
 

Will Dieterich said:

I got the textbox to work!

I was goofing around and did as everyone else has done for text box, then I went and swiched the line

<asp:textbox runat="server" id="textbox1"></sp:textBox>

to

<input id="textbox1" name="textbox1" type="text"/>

then with using a form(textbox1) instead of a control(textbox1) everything works.

I can set the filter in the dataview and it reads in,even with a reboot.

April 27, 2009 11:23 AM
 

Ned said:

Has anybody figured out how to get rid of duplicates showing in your dropdown? There were a few people asking this but I haven't seen an answer, I've tried almost everything to get rid of them. I know I can make seperate lists but I don't want to do that.

May 4, 2009 3:51 PM

Leave a Comment

(required) 
(optional)
(required) 
Submit

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker