Solved

ASP.NET dropdownlist refresh gridview

Posted on 2007-11-30
5
2,335 Views
Last Modified: 2011-09-20
Does someone have an example of how a dropdownlist selection can populate the content of a gridview based on the selection?

I have a sqldatasource that populates the dropdownlist when the form loads and I'd like to fire off the SelectCommand for the second data source which is tied to the gridview. I tried putting a SqlDataSource.select() command under the ddl_vendor_list_TextChanged subroutine but its not recognizing the datasource.

Any examples?
Thanks!!
0
Comment
Question by:wppiexperts
5 Comments
 
LVL 3

Expert Comment

by:pablo_munoz
ID: 20385742
Why not call a function on your event that returns a datatable to populate the Gridview?
0
 

Author Comment

by:wppiexperts
ID: 20385940
I think I'm getting closer....if I'm pulling in two values to populate my dropdownlist (one is the value to use in the select statement and one is the displayed value)...how do I reference the "hidden" value that is used to populate the dropdownlist? All I seem to be able to reference is the selected value.
0
 
LVL 20

Expert Comment

by:brwwiggins
ID: 20385980
If you run through the wizard I think it gives you the option to select which value of the ddl you want to use. I'd have to lookup some code for it
0
 
LVL 20

Expert Comment

by:brwwiggins
ID: 20386062
I might retract my previous statement, I think you can only do the selected value but you should be able to configure your dropdownlist accordingly
0
 
LVL 10

Accepted Solution

by:
digitalZo earned 50 total points
ID: 20387111
DataValueField = "hidden value OR the value used in the select statement"
DataTextField = "the value which you want to display"

It applies to DropDownList.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
IIS redirect 1 79
Deploying to Azure 3 39
Iteration Help (Asp.net VB) 5 25
C# MVC Insert Multiple Row into DB 2 32
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question