Solved

Conflict between DropDownList and Gridview

Posted on 2006-07-04
4
530 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
[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
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

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…
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.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

635 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