Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Conflict between DropDownList and Gridview

Posted on 2006-07-04
4
Medium Priority
?
540 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

715 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