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

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT
Post New Web Links

help with drop down lists

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :ASP.Net
Hello i have 4 ddl for factory, category, model and engine im tryin to make connection between them so i could select factory and then the other ddls will change the data that relative to the select item on factory. I know how to make connection between them but i need to use AppendDataBoundItems so the user could select "all models" or "All categories" without success!!! when i select factory the category get the models and when i select different factory the new model join the other factory models and so on and on. i was try with ajax cascading ddl but i didnt success cause the user need to have the change to select factory and engine (for example) but the engine is enabled = false until the user select 3th ddl PLEASE HELP

View Complete Post

More Related Resource Links

Create a placeholder for drop down lists


First time post here, if i'm in the wrong area please move as necessary. Thanks

I'm using VWD with a database back end. I have a list of teams which are marked off by league, level, division, teamid and then using gridview for the list of players per teams.

I've got the drop downs working correctly but running into a little snag and that is on the auto postback.

When I only have one option come up in a list, i obviously don't change that list and thus it doesn't change the next drop down because there is no post back. is there a way to use a "header" value?

Example of my data

League Level Division Team

NHL 1 West Vancouver
NHL 1 West Calgary
NHL 1 West Edmonton
NHL 1 Central Chicago

OHL 2 West London
OHL 2 West Guelph

NBA 1 Central Chicago
NBA 1 Central Detroit
NBA 1 Central Milwaukee

So my drop downs choose by league, then level then division and then team then shows the player roster for that selected team.

The problem I run into is when only one value exists based on the previous choices I've made. If I choose NHL then Central only Chicago shows up in the example above. Because I'm not choosing between it and another value, the drop down does not put in a post back and thus I don't get a list of the team and then the players

how do i develop a cascade drop down lists which get the chart names from excel sheets

hi i have to develop a cascade dropdownlist. one of the drop down is used to retrive only excel docs from a specific doc library and and the other drop down to get all the chart names and attach it to the second dropdown list in doc lib item changed event thanks    

Creating a generic template writer that can handle drop downs and option lists


If I have a the following model

public class User
		public List<Company> Companies;
		public string Login { get; set; }

		[DisplayName("First Name")]
		public string FirstName { get; set; }

		[DisplayName("Last Name")]
		public string LastName { get; set; }

		public string Password { get; set; }

		private int Company { get; set; }

And the following generic control template writer (which would have to be extended appropriately)

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<% foreach (var prop in ViewData.ModelMetadata.Properties .Where(pm => pm.ShowForEdit && !ViewData.TemplateInfo.Visited(pm))) 
{ %>
	<div class="SD_FieldItem">
		<% if (!String.IsNullOrEmpty(Html.Label(prop.PropertyName).ToHtmlString()))
			switch (prop.ModelType.Name)
				case "Boolean":

						<div class="SD_BoolField">
							<%= Html.CheckBox(prop.PropertyName) %>
							<%= Html.Label(prop.PropertyName) %>
							<%= Html.ValidationMessage(prop.PropertyName, 

cascading drop down lists from single table


my one table consists of fields (id, flying from, flying to). thus i have one drop down for flying from and another drop down for flying to. i'm hoping to cascade them so 2nd drop down values are dependant on the values from 1st drop down. is it possible to do this using a single table? or must i use two tables and link the id's from both? and do i write anyting in the SelectedIndexChange event? thanks...

the sqldatasource code looks like this:

Flying From:

        <asp:DropDownList ID="ddlFlyingFrom" runat="server" DataSourceID="SqlDataSource1"
            DataTextField="FlyingFrom" DataValueField="Id" AutoPostBack="True" OnSelectedIndexChanged="ddlFlyingFrom_SelectedIndexChanged">

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
            SelectCommand="SELECT [Id], [FlyingFrom] FROM [Flights]"></asp:SqlDataSource>

pass a value to the 2 Master/Detailed drop down lists


using below code, I bind 2 drop down lists.

    <asp:SqlDataSource ID="sdsCountry" runat="server" ConnectionString="<%$ ConnectionStrings:Conn %>"
        SelectCommand="SELECT tbz_CountryID, tbz_CountryName FROM AZ_Country"></asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsCity" runat="server" ConnectionString="<%$ ConnectionStrings:Conn %>"
        SelectCommand="SELECT [tbz_CityID], [tbz_CityName] FROM [AZ_City] WHERE ([tbz_CityID] = @tbz_CityID)">
            <asp:ControlParameter ControlID="ddlCounty" Name="tbz_CountryID" PropertyName="SelectedValue"
                Type="Int32" />

And using the below code, I pass the content of GridView selectedRow cell to that DopDownLists .

 Protected Sub gvTax_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
      With gvTax.SelectedRow ddlCountry.SelectedValue = .Cells(26).Text Try ddlCity.SelectedValue = .Cells(28).Text Catch End Try End With End S

fx Controls instead of Drop Down Lists for Lookup fields in InfoPath Secondary Data Connections


I have a secondary data connection with a lookup field into another list. To display the fields text value instead of the index, I am using a drop down list which gets its choices from the linked list. This information is read-only so I disabled the control via formatting rule.

A calculated value control might be better suited, but my XPath skills are not very "developed". Has anyone done this before? Taken the index from the bound field and extracted the text value from a second data connection? Thx


After applying custom master page, "Current View" drop down is no longer functional on Lists


The "Current View" drop down is not dropping down anymore when on the list library ribbon with a custom master page applied. Of course, it does work fine with v4.master. I would list all the custom master page changes however they are numerous. So I am looking to see if there are any ribbon experts that can give me things to at least look for. I would really appreciate it! Thanks!

Using 2 drop down lists to display dress size by Country version??




I have a Dress Version Table with Colums UK, EU, USA.

Also a Dress Size table which has a VersionId Column corresponding to the Version Table


On my aspx, i have two drop down lists. DD1 is binded to an objectdatasource which

has a select Method to the DAL and retrives the 3 Verions.


DD2 has Get DressSize by Version Method with a Select Parameter which is the DD1 selected Value.

I have wrapped the above in an update panel and the full code is below.


This works but I wonder if there is a better way of doing this?? I also have a probem

in that the Dropdowns are in a panel that is within a modal pop up extender. When

the dropdowns post back the whole panel disappears. Not sure why??





   Dress Size:

   <asp:UpdatePanel ID="UpdatePanel2"

Multiple Cascading Drop Down Lists - Browser



We have a requirement to implement quite a complex cascading drop down list solution. I am aware that there are numerous articles on how to do this however I would like to confirm if it is possible to achieve the following:

1. A drop down list with multiple selections for field A. User selects field A.
2. Field B is automatically populated based on field A which was selected above.
3. A filtered drop down list appears for field C. This filtered drop down list is based on field A & B which was previously selected. User selects field C.
4. Field D is automatically populated based on field C which was selected above.
5. Field E is automatically populated based on field C which was selected above.
6. Field F is automatically populated based on field C which was selected above.

My programming skills are very limited and how I would ideally like to connect the form to a list in SharePoint so that the values can be easily maintained. We are using a browser form and would appreciate any ideas or suggestions on how to create the above functionality. Just out of interest, The custom drop down list for field C will probably have 100 values and overall we have about 5000 records which need to be autopopulated and filtered.

Thanks for any help


Drag n Drop files in Outlook Sharepoint Lists





Can you let me know how to enable drag and drop of files in Sharepoint List in Outlook 2007. I have installed MOSS 2007. Currently its in read only mode.




Displaying SharePoint lists in Web Parts

When you create a built-in or custom list in Microsoft Windows SharePoint Services, Windows SharePoint Services creates a Web Part, a basic building block of a SharePoint site, to display that list. These Web Parts are called List View Web Parts. Windows SharePoint Services stores List View Web Parts in the site collection Web Part gallery. (The site collection Web Part gallery is the most central gallery of Web Parts for a work group. By default, the gallery name is the name of the site, such as "Our Team Site Web Part Gallery." )

SharePoint Tutorial - Lists

A list is a feature in SharePoint that stores a lists of information. For example, a list can be created to store web links in the human resources team site. A list is usually created for a specific type of information. Lists can contain metadata to describe the particular information in more detail and to make it easier to find.

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET

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).

Drop-Right/Left submenus


 I'm currently using the CurvedMenuProjects custom control and I does almost everything I need a Menu Control to do but it doesn't swap submenu position (left/right) when the dropdown goes off the right edge of the screen.


Does anybody know if it's possible to configure the control to do this?


Any pointers on how I can get started writing the behavior into the custom control myself?




Wicked Code: Drag and Drop with ASP.NET AJAX


Jeff Prosise shows how you can implement drag-and-drop functionality in your Web app with ASP.NET AJAX.

Jeff Prosise

MSDN Magazine January 2008

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