Solved

ASP.NET dropdownlist refresh gridview

Posted on 2007-11-30
5
2,333 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Code works but how can I download the file? 20 67
Handle null when using linq in this line 1 26
Asp.net mvc foreach 3 33
Receiving a string from a WebService Push 21 36
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now