?
Solved

ASP.NET dropdownlist refresh gridview

Posted on 2007-11-30
5
Medium Priority
?
2,339 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 150 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

762 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