Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP.NET dropdownlist refresh gridview

Posted on 2007-11-30
5
Medium Priority
?
2,342 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

610 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