473,387 Members | 1,603 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,387 software developers and data experts.

Gridview rows inverse order

dotneto
36
Hi,
I'm working on a gridview with an object datasource. I send the sort expression and sort order to the selecting method through a parameter. It works fine in the ascending order, but in the descending order, when the grids navigates to the first page and shows the data for that page, the first row is in the last position, the last in the first and so on.
If I navigate away, to another page in the grid, the data is fine, and if i go back to page 1, the data is in the right order now. This is very weird.

I cannot post much of code. Maybe I'm asking miracles but if anybody have an idea. .
I checked the datatable returned and the data is in the correct order so the problem comes later.
Thanks.
Aug 8 '07 #1
1 1197
dotneto
36
Got an answer from a friend. The grid mantained the sort expression and sort direction so it resorted the data after the data came from the datasource.
Fixed by resetting the values of sortdirection to the right ones. Like : e.sortdirection = "ASC", or e.sortdirection = "DESC".
Aug 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: tfsmag | last post by:
Hello, I have a function that returns a dynamically created gridview. This works fine, however it does not seem to be able to maintain state when adding sorting or paging to the gridview. Does...
4
by: Marcos Beccar Varela | GamaCom Argentina | last post by:
Hello Everyone. I need to use a gridview, that when I use the Update command one of the colums, instead of showing a textbox where the user can write, I need a combobox (listobx), where there are...
3
by: justin | last post by:
One of the gridviews i'm using now apparently needs to have the added functionality of re-arranging the order of the records it's representing. These records have a priority field which the dataset...
0
by: ssims | last post by:
I've got a GridView that's sorted by a stored procedure with ROW_NUMBER: PROCEDURE dbo.GetCalendarsByStatusIDPaged ( @startRowIndex int, @maximumRows int, @statusID int ) AS
0
by: VMI | last post by:
In my web app, my gridview is attached to a datatable whose rows are added through a button. So when I click on a button under the gridview, I add a row to the datatable and databind the gridview...
1
by: SachinSachin | last post by:
Hi All, I am implementing a custom gridview control, that emits some javascript to blink a row whenever a new row is added in gridview. The gridview is inside the <asp:updatepanel> for...
51
by: kjewell23 | last post by:
Hello, I'm new to this asp.net 2.0 I need help?? My database is coming from AS400 which uses odbc Commands. i have data in the dataset but nothing showing in my gridview. However the data does show...
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...
0
by: KeesH | last post by:
Hi, I am quite desperate now because I made a nice webshop with a gridview where the customer is able to update the amount of products (Hostas in my situation) or delete the row. The problem is...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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?
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
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,...

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.