473,396 Members | 1,809 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 problem

I have a gridview with a sqldatasource and an aspx web form that enables the
user to search on different criterias. Based upon that I generate dynamic
sql
and programmitically feed this into selectcommand and selectparameter of the
sqldatasource. I get the desired result in the gridview but when i enable
paging and sorting I get an empty grid when i try to page or sort.
Another thing: when I click on a link field in the grid for detail
information on another
aspx page and return with the browser back I also get an empty grid.

Any suggestions?

regards
Jan E Hansen, Oslo
Aug 3 '07 #1
2 1366
Rebind the DataSource to the gridView after changing the page index
--
JP
..NET Software Developer
"Jan Erik Hansen" wrote:
I have a gridview with a sqldatasource and an aspx web form that enables the
user to search on different criterias. Based upon that I generate dynamic
sql
and programmitically feed this into selectcommand and selectparameter of the
sqldatasource. I get the desired result in the gridview but when i enable
paging and sorting I get an empty grid when i try to page or sort.
Another thing: when I click on a link field in the grid for detail
information on another
aspx page and return with the browser back I also get an empty grid.

Any suggestions?

regards
Jan E Hansen, Oslo
Aug 4 '07 #2
Thanx that helped!

But I still have a problem when leaving the grid page to show some extended
details for a row and return with javascript:history.back() the page is in
initial state. I use masterpage with content pages.

Regards

Jan E.Hansen

"JP" <JP@discussions.microsoft.comskrev i melding
news:1C**********************************@microsof t.com...
Rebind the DataSource to the gridView after changing the page index
--
JP
.NET Software Developer
"Jan Erik Hansen" wrote:
>I have a gridview with a sqldatasource and an aspx web form that enables
the
user to search on different criterias. Based upon that I generate dynamic
sql
and programmitically feed this into selectcommand and selectparameter of
the
sqldatasource. I get the desired result in the gridview but when i enable
paging and sorting I get an empty grid when i try to page or sort.
Another thing: when I click on a link field in the grid for detail
information on another
aspx page and return with the browser back I also get an empty grid.

Any suggestions?

regards
Jan E Hansen, Oslo

Aug 7 '07 #3

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

Similar topics

8
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my...
3
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
2
by: Loading name... | last post by:
Hey asp.net 2.0 I have a GridView on my webpage. This GridView's datasource is a SqlDataSource. The SqlDataSource returns 3 columns. Here is my problem: My GridView consist of 3 columns...
3
by: Jeff | last post by:
Hey asp.net 2.0 In the source I posted below, there is a GridView (look at the bottom of the script): <asp:GridView ID="gvwOnline" runat="server"> </asp:GridView> I'm trying to assign a...
2
by: antonyliu2002 | last post by:
I've been googling for some time, and could not find the solution to this problem. I am testing the paging feature of gridview. I have a very simple web form on which the user can select a few...
8
by: =?Utf-8?B?TWlrZSBSYW5k?= | last post by:
I am trying to get a list of files from a specified directory using the System.IO namespace classes, and then use that list as the datasource for a GridView. I have been able to do this...
1
by: Jeff | last post by:
ASP.NET 2.0 I've got problems with the right column in my GridView. The GridView consist of 2 columns, the problem column is the column on the right side. The problem is that it looks like...
2
by: GISmatters | last post by:
I have unbound checkboxes in a nested gridview to allow multi-selection of "child" rows. For context, the parent gridview rows are for large "reports", the child rows are for various specific files...
6
by: RobertTheProgrammer | last post by:
Hi folks, Here's a weird problem... I have a nested GridView setup (i.e. a GridView within a GridView), and within the nested GridView I have a DropDownList item which has the...
11
by: Ed Dror | last post by:
Hi there, I'm using ASP.NET 2.0 and SQL Server 2005 with VS 2005 Pro. I have a Price page (my website require login) with GridView with the following columns PriceID, Amount, Approved,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.