Solved

Conflict between DropDownList and Gridview

Posted on 2006-07-04
4
493 Views
Last Modified: 2012-05-05
Hi I am still fairly new to Web Development so please be easy with me if this is simplistic question :-)

I am using Visual Web Developer/VS2005 and VB.NET and on one particular web page I have both a Dropdownlist and a Gridview.

The gridview is bound to a SQL Table and when it is on it's own (i.e. without the dropdownlist on the same page the gridview works fine.

If I then put the dropdownlist on the same page, and bind it to another table in the database the gridview still works fine.

If (and this is how I want it) I manually add items to the dropdownlist and don't bind it to a table) then the gridview will not even display on the page.

I am at a loss as to why this should be, as the gridview and dropdownlist are not linked, and neither are the tables in the database.

Any help to get me going again would be very much appreciated.

Many thanks
...Steve
0
Comment
Question by:swtiley
  • 3
4 Comments
 
LVL 1

Author Comment

by:swtiley
ID: 17039309
Oh one additional piece of information - the dropdownlist and gridview are together in a webusercontrol.

...Steve

0
 
LVL 5

Expert Comment

by:nickhoggard
ID: 17040782
Hi,

When you say the gridview will not even display on the page, does it provide you any error messages?

Could you possibly provide a sample of the code you are using to add the items to the drop down list?

Cheers

Nick
0
 
LVL 1

Author Comment

by:swtiley
ID: 17040874
Hi Nick,

Thanks for the response.

I have now set up a "new" web-site consisting of one page and webuser control.

On the webuser control, I put one dropdownlist and one gridview, and then put the webusercontrol onthe webpage. If the dropdownlist is not bound to a datasource the gridview simply does not display.

There is no error message or anything, simply nothing happens (seems bizarre to me :-)

- In the new example I am not even trying to populate the dropdownlist - however for reference the code I previously used to populate the dropdownlist is


---------------
 If Not Page.IsPostBack Then
            cmdDB.CommandText = "SELECT Store_Name, Store_Number FROM opappslive.dbo.APPT_Store_Details order by store_number"
            rsDB = cmdDB.Execute
            rsDB.MoveFirst()

            DropDownList1.Items.Clear()
            DropDownList1.Items.Add("Unknown")
            While rsDB.EOF = False
                DropDownList1.Items.Add(Mid(rsDB.Fields("store_number").Value, 3, 4) & " " & rsDB.Fields("store_name").Value)
                rsDB.MoveNext()
            End While
        End If
       
    End Sub

----------------

Thanks forany help
... Steve
0
 
LVL 1

Accepted Solution

by:
swtiley earned 0 total points
ID: 17045532
OK - thread can be closed as resolved by myself
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

10 Experts available now in Live!

Get 1:1 Help Now