.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

Populating 3 dropdown each other.

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :ASP.Net
Hi all, I have a complicate problem.  I'm not sure if I can explain it clearly.I have SQL table with columns:  id, PartNo, ManuPartNo, GovtPartNum.My boss want to do like this with 3 dropdown or 1 Dropdown with 2 listbox:  If he select any PartNo, it will pull associated value For ManuPartNo & GovtPartNumAlso, if he select any ManuPartNo, it will populate back to other dropdownAlso, if he select any GovtPartNum, it will populate back to other dropdownI'm so stuck & I don't know where to start on this.  Can anyone help?Thanks

View Complete Post

More Related Resource Links

Populating Dropdown List using FK


Hi Folks,

2 Questions. I am trying out Data Entities in VWD 2010 Express. I have a parent (Customers) and child (Orders) table. Customers table has FirstName, LastName and Email columns.

Q1. When I view/edit/insert an Order, it shows the customer's first name in dropdown list whereas I want the full name. How can this be done?

Q2. How can I change the default behavior of PK/FK relationship so that customer's Email is displayed instead of Name?

Any help will be much appreciated.


Dynamically (on client side) populating data control (repeater) when dropdown item is selected

Hello!I'm currently working on a project and I want to make as much things as possible performing on client side - with as little loading as possible.The project consist of three "main" pages. On one page I use jQuery DataTable plugin which is working great. One page has tabs (using jQuery). I want to put datacontrol (repeater) on this site and when  user selects one item in dropdown, data in repeater loads on client side, without performing the action on server.I wonder if this is possible and if somebody can give me some case to help with?Thanks!I hope I was clear enough. all the best

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

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   

Populating a DropDown ListBox from an Enum


I have this simple Enum defined:

    public enum Grade : byte
      Up = 1,
      Down = 2,
      Flat = 4

I've tried using it to populate a DropDown ListBox like this:

    ddList.DataSource = Enum.GetValues(typeof(Constants.Grade));

The problem is that BOTH the Text and the Value of each ListItem ends up with the text string.  What I want, of course, is for each ListItem's Value property to be populated with the numeric value.

Is there a simple way to do this?


Problem with populating dropdown in code behind


Hi all, I'm having problems with this code not adding the list items to my dropdown. I was hoping someone could point out why.


On my aspx page I have:

<asp:DropDownList id="AS400_wh_c1_act" runat="server"></asp:DropDownList>

<% PopDrop(AS400_wh_c1_act)%>

In my code behind, I have:

    Public Sub PopDrop(ByVal input As DropDownList)
        input.Items.Add(New ListItem("", ""))
        input.Items.Add(New ListItem("PAGER", "PAGER"))
        input.Items.Add(New ListItem("EMAIL", "EMAIL"))
        input.Items.Add(New ListItem("STANDBY", "STANDBY"))
    End Sub

However, the dropdown list isn't adding the new items.

Anone know what I'm doing wrong?


what is the syntax for populating dropdown in Javascript using web service?



I have written the web method in web service like this


    public List<Location> FindAllCountries()
        List<Location> locations = new List<Location>();
        string connectionString =
            "Data Source=.;Initial Catalog=Test;Integrated Security=True";
        using (SqlConnection connection = new SqlConnection(connectionString))
            using (SqlCommand command = new SqlCommand())
                command.Connection = connection;
                command.CommandText = "SelectAllCountries";
                command.CommandType = CommandType.StoredProcedure;
                using (SqlDataReader dataReader = command.ExecuteReader())
                    Location location;
                    if (dataReader != null)
                        while (dataReader.Read())
                            location = new Location();
                            location.CountryID = (int)dataReader["CountryID"];
                            location.CountryName = Convert.ToString(dataReader["CountryName"]);
        return locations;

I m calling the webservic

Dropdown list in ASP.NET - How to get value selected

am sure this must be very simple, but unforunately I can't figure it out.
I have the following code which populates the dropdown lists from the database. This works fine. Now, when the user selects a particular employee name from the list, I want to get the Employee Id of the selected employee. i.e. I need to get the "Eid" value. I can do this if the EId is loaded in the dropdown list, but in this case only the employee name is displayed. Please let me know howI can get the Eid value even though it is not loaded in the dropdown list.
I would really appreciate your help

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

Binding an array to dropdown list


I have the following string which is a list of urls. How do I get this to work so the url shows for the selection and also is the value?      


allLinks = newAllLinks
        Me.DropDownList1.DataTextField = "Link"
        Me.DropDownList1.DataValueField = "LinkURL"
        Me.DropDownList1.Items.Insert(0, New ListItem(" - Select - ", 0))
        Me.DropDownList1.DataSource = allLinks


 ArgumentNullException: Value cannot be null.
Parameter name: container]
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +121
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName, String format) +8

Gridview with a dropdown list for editing


Hello. I am working through Scott Mitchell's ASP.Net in 24 hours book. I am finishing the photo album project.

I have a GridView that retrieves a list of uploaded photo rows for the logged-in user.
The GridView is for editing and deleting rows.

The photo Category field in the Gridview is a dropdown list. The text entry field was deleted after converting this field to a Template.

Like the uploaded photos, these Categories are user-specific. They are created in another web page.

Users also have the option to select "none" for the category when they upload an image.

For the GridView:  The Category ID field's ItemTemplate and EditItemTemplate both have a " - None - " choice added to them.

I am getting this error:

'pictureReadOnlyCategories' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value


Note: The ID for the ItemTemplate for that dropdown list is the ID listed above in the error: "pictureReadOnlyCategories".


Am I missing some step in this process of changing a GridViews text field to a dropdown that can be used for editing? I went through the book's instructions three times.

Here is my code for the dropdown list and a screenshot of the Design

Dropdown Event (Template Field)



I have grid view control that includes a dropdown control in a template field.

I wish to execute some code when the value is changed in the dropdown list.  Can't figure out how to capture this event though?

Any suggestions?

About DropDown in MVC


Heelo evrybody!Thanks 4 All!

i try to Load data into Dropdown in MVC, but i cant.i followed MVC MusicStore.but when  i create a album, i want to load Genre in to Dropdown for selecting.But there is an eror "Object not reference to Object..........".i hope somebody can help me

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