473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Gridview never shows data

Hi,

I have 2 gridviews on an asp.net 2.0 form.

When I click select on a row in the first grid, in the
GridView1_SelectedIndexChanged event I set the value of a textbox (with
visibility set to false) to a string representation of a guid before calling
databind on my second grid.

The second grid never shows any data though, in fact it does not even show
the headers on the page unless I change its datasource to return all records,
not just filtered for the one selected in the first grid.

I initally just used a select statement in the datasource with an object
form parameter which got the value from my hidden text box, but I changed
that now to use a stored procedure that takes a string parameter and converts
that to a GUID inside the stored procedure.

If I configure the datasource when I test the query (which is the stored
procedure) I enter the valid guid in the parameter prompt and it does return
the values I should get in the test results pane.

My Datasource is set up as below and the value in txtLocationID at the point
where I call DataBind (on both the datasource and the gridview) is correct:
<asp:SqlDataSource ID="FIDS_AdPages" runat="server"
ConnectionString="<%$ ConnectionStrings:FIDSConnectionString %>"
SelectCommand="AdvertPage_ReturnForLocation"
SelectCommandType="StoredProcedure">

<SelectParameters>
<asp:FormParameter FormField="txtLocationID"
Name="LocationID" Type="String" />
</SelectParameters>

--
Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com
Feb 2 '08 #1
0 900

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: theKirk | last post by:
using Visual Studio 2005 C# ASP.NET I know there has to be a simple way to do this....I want to use C# in a code behind for aspx. Populate a GridView from an xml file Add Fields to the...
2
by: Krish | last post by:
Hello Gurus, I have Master GridView & Detail Gridview and following another detail gridview control. On "select" master grid , detail grid shows data, On "Select" No. 1. detail grid, No.2 detail...
1
by: Krish | last post by:
Hello Gurus, I have Master GridView & Detail1 Gridview & Detail2 Gridview controls. On "select" master grid , No. 1detail grid shows data, On "Select" No. 1. detail grid, No.2 detail grid shows...
1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes...
0
by: kieran | last post by:
Hi, I was using the datagrid and am now starting to use the gridview in asp.net 2.0. I used to use the first below sub for when i would mouseover a row - this highlighted the row but did not...
2
by: Nick Hodge \(MVP\) | last post by:
Hi I currently have a gridview connected to a SQLDatasource. (This data comes from a remote iSeries). It shows catalogue sales as they build during the day (works great). I have a local SQL...
4
by: Ken Wigle | last post by:
All, I would be very grateful for any help on this question. I have an application in asp.net 2.0 where I dynamically create a datatable and then bind that to a gridview. Unfortunately, the...
2
by: needin4mation | last post by:
In a GridView, take for example a delete button. When I click the delete button in my GridView the GridView row is deleted and the GridView rebinds and refreshes the records to show accurately. ...
2
by: John Straumann | last post by:
Hello all: I am trying to populate a GridView with data being read from a call to a web service. I have seen plenty of examples that simply execute a SQL data reader, set the Grid data source to...
7
by: =?Utf-8?B?U0FM?= | last post by:
I am trying to cast my Gridview in my Code behide as a Dataset so I can manipulate the data. Here is the code snippet: Dim FilteredDataSet As New System.Data.DataSet Dim gv As New GridView gv...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.