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

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

Dropdown lists - showing items based on value

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

Hi, i have over 100 items all loaded in a dropdown list. They all are assigned a value between 1-10 which represent 10 categories.

When certain buttons are clicked, i want the dropdown list to display only items with a value "1" or "2", etc.

How can this be done?

View Complete Post

More Related Resource Links

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

Forms based users being prompted for windows authentication login for My Sites photos in user lists

Here's an issue I didn't see coming for our forms based authentication users. 

We have a web application extended to an external url to handle forms based authentication for users outside of our domain. Our setup looks like this...

Internal Users/Windows Authentication - moss.domain.com
External Users/Forms Based - mossext.domain.com
My Site for Internal Users - mysites.domain.com

When our forms based users are accessing user lists, or discussion pages that display user pictures, they are getting a windows authentication login for our internal users (mysites.domain.com) who have populated their my site with personal photo.

How do we fix this? 

Content and Structure Report not showing all items

I have an environment where the Site Owner is not seeing all items pending approval when they access that view from the root node in the Content And Structure section.

We can see pending items in this view if they access some of the lower level nodes in the tree structure, just not from the top node.

I've noticed that the second level nodes are not inheriting permissions from the root node, but I'm not sure if that is relevant. I've also checked the CAML for the Pending Approval view and it has not been altered in any way.

Any ideas?

how to hide/display controls in NewForm.aspx based on dropdown value in SharePoint list



I have 1 dropdown in my sharepoint list with other columns. If dropdown value equal to 'xyz' i need to display some other controls, otherwise these controls should be hidden.

I know we can achieve this with javascript. If any one can provide code or sample then it will be appreciated. or is there any other alternative methods to do this ........

Thanks & Regards, Neerubee

On New Item form, select item on choice dropdown based on query result.


I posted this on Experts Exchange awhile back with no answer, so here's hoping someone here has an idea :)

So I've mostly figured this problem out, but I need some help in getting over the hump... note that I'm using JavaScript to do this (SPServices) on SharePoint 07'.

I'm on the New Items page of a list. Based on a user's selection in a "Teacher" dropdown, I'm doing the following:

1.) Get the value of the Teacher field and several other fields (School and Visit Date)
2.) Run a CAML query based on those fields to find the last list item entered for that Teacher

So here's where I'm stuck...

I have 10 choice fields, all with choices 0, 4, 7, and 10. Depending on what they were set to in the last entered item (which I queried), I want to set the selected item on each of those dropdowns to equal that. So "Score 1" was set to "4" on the la

Best architecture for showing mathematical formula based charts to end user

Hi All, We have one new project to implement. Let me explain briefly about this project. This project is related showing chart to end user on the basis of different mathematical calculated formulas. End user has authority to change these formulas on the fly and on the basis of that changed formula we need to show the chart. So this is all central idea about the project. These charts which I mentioned above are very complicated and user friendly             So can any buddy tell me which is best suitable architecture for this and how can fit her to my scenario .I knows, three tier architecture and some other are there but I want know which is the best architectures that developed above idea in right way   Any helps for above is really appreciate  

Versioning lists in Sharepoint (not list items)

I need to keep a track of what all changes have been made to a custom list since it was first created. I need to have track of what columns were added/removed and when. I know that we have versioning for list items so as to keep track of what all changes have been made to an item but what I am looking for is versioning of the list itself rather than the list items. Is this possible?

Building SSRS reports based on SharePoint 2007 lists

Hi,   I'm building a SSRS report, and I want to get data out of a SharePoint 2007 list. The difficulty I'm facing is the following: The SharePoint server is behind an ISA Server, and is configured for Form-Based Authentication. Is there a way to keep the FBA and retreve information out of a SharePoint list with reporting services?   Kind Regards,  AVermaas    

showing number of items in sub folder

Hi, In "All Site Content", we can see the number of items under each folder. But when we open the folder for example Documents, if it has sub folders, there it does not list the number of items. How to list the number of items in the sub folders. Thank you

Populating dropdown based on checkbox value in Infopath

Hi I have created a form library with the following values ID  Document   Preference 1   A                Yes 2   B                No 3   C                Yes   I have a drop-down and a checkbox in an infopath form. This dropdown will by default display the ID numbers. When a user checks the checkbox, then the dropdown should display only the id's that has "Preference" value equal to "Yes". I am using Infopath 2010 How to do this...Any suggestions...

Gridview Editing with dropdown lists inside

  Hi, Any good  Example for Editable Grid with dropdownlist inside ? Getting some problem in updating the data   Thanks 

filter a dropdown based on a check box value

Hi I created a dropdown in the infopath that will lists all the ID's from a sharepoint list. Then I added a checkbox in the form. When a user selects/checks the check box, the dropdown list should display only the student ID's Sample list I used ID    category 1      student 2      master 3      student 4      student 5      master How to do this. Any ideas, I am new to infopath 2010.

asp.net and dropdown lists

I have an assignment that is way overdue and need some help in setting it up.  It says to have two additional dropdowns that allow selection of a telephone handset and a service plan adn this info comes from an access database.  Three check boxes should allow independent selection of the 3 additional options (which are voicemail, unlimited data, unlimited text) available.  I already tried doing this using but found that I would need to update all the fields in the database after the entries have been made.  Can someone please help me in setting this up?  I don't expect anyone to do it for me, just need some help with how to set it up.  This is from a class last spring and my memory is somewhat boggled.   Frantically frustrated :-(  

Populating a dropdown box with contents based on the selection of another dropdown box

Hi All   I am a complete newcomer to ASP.NET.  However in the few weeks I have been playing with it I have got pretty far and  have mastered things like stored procedures, gridviews, formviews and templates.  I have come across a problem which I am struggling with and could do with some help!  The scenario is this:   I have a dropdown box which is populated from SQLDataSource1   I have a second dropdown box which is populated from SQLDataSource2, but i need the query feeding this to be dependent on what was selected in the first dropdown box.    I assumed it would simply be a case of modifying the select statement on SQLDataSource2 using the SelectedIndexChanged event on the first DropDownList to update the second SQL source, but I cannot work out for the life of me how to do it.  Pretty much all of the code I have is ASP.   Is there a way I can do this purely in ASP rather than using VB behind the scenes or do I need to use VB?  I am pretty comfortable with vb.net but one of the other issues I have is referencing an ASP object from VB... so for instance if I had a text box in ASP, how can I read or change the properties of this object from VB?   FYI I am using Visual Studio 2010 and SQL/Server   Any help much appreciated!!!   Sean   

View All Site Content Showing the wrong number of items

NOTE:  Similar post also had no answer: http://social.msdn.microsoft.com/Forums/en-US/sharepointecm/thread/f775ba0d-648f-4be3-9017-78539915b281/ I am the Site Collection Administrator/and also tried logging in using Farm Account.  I go into View All Site Content and I show 15 documents.  When you actually go to the All Items view (and I double-checked, no filtering), you only find 9 documents.  Versioning is not turned on.  I am a developer, so I also used the Web Service to try to troubleshoot.  The Lists.asmx web service shows an Item Count of 15 using the GetList method.  However, using the GetListItems method, the item Count reports 9 items, which is what I see in my browser. Is there an stsadm command that I can run that will "true up" this number being reported in View All Site Content? Thanks in advance. - Update -  MOSS 2007 v 3.0 server farm.

Is it possible to disable context menu items based on the selection on Treeview

I will have some sort of nodes for a treeview as follows Root |-> some.txt(A text file which was added at runtime) |->Child(child for some.txt) |-> child1(child for child) I designed my context menu with some options as New and Remove What i need is when i righclick on Root, child or child i would like to disable the Remove option

populate dropdown based on attribute criteria

Trying to load a dropdown list with the 'name' attribute from the category node...must be missing something: The xml: <Settings>  <department name="Accounting">    <category name="Bank Information">    <category name="Form Information"></Settings>    The code I'm attempting: XmlDocument settingsdoc = new XmlDocument();                settingsdoc.Load(Server.MapPath("/XML/Settings.xml"));                XmlNodeList nodeList = doc.SelectNodes("Settings/department[name='Accounting']");                 foreach (XmlNode node in nodeList)                    CategoryDDL.Items.Add(new ListItem(node.SelectSingleNode("//department/category[name]").InnerText)); CategoryDDL.DataBind();   Any idea what looks wrong? Thanks!
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