Solved

ASP.NET dropdownlist refresh gridview

Posted on 2007-11-30
5
2,332 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
Comment Utility
Why not call a function on your event that returns a datatable to populate the Gridview?
0
 

Author Comment

by:wppiexperts
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

14 Experts available now in Live!

Get 1:1 Help Now