473,402 Members | 2,050 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,402 software developers and data experts.

sort not working correctly

I'm trying to sort my grid and its working halfway, I can only sort the grid
once and it puts everything in ASC order (1234555666) and i can't sort it
again to display as DESC order (6665554321),

what could be causing this?

Nov 18 '05 #1
4 1265
On Wed, 18 Aug 2004 05:59:01 -0700, IGotYourDotNet wrote:
I'm trying to sort my grid and its working halfway, I can only sort the grid
once and it puts everything in ASC order (1234555666) and i can't sort it
again to display as DESC order (6665554321),

what could be causing this?


Did you switch your sorting expression like below ?

"ColumnFOO" - "ColumnFOO Desc"

If you could post your grd_SortCommand I could help more

- Oytun YILMAZ
Nov 18 '05 #2

the stored procedure needs to do the asc and desc

select *
from emp e
order by @column_name // pass the column name to sort
asc

you can then return the sorted result

hope this helps
-----Original Message-----
I'm only doing
sub datagrid1_sortcommand()
bindGrid(e.sortExpression)
end sub

the bindGird calls Stored Procedures to bind the datagrid

Its sorts the grid, sort of, i need in asc and desc when I click the column.


"Oytun YILMAZ" wrote:
On Wed, 18 Aug 2004 05:59:01 -0700, IGotYourDotNet wrote:
> I'm trying to sort my grid and its working halfway, I can only sort the grid > once and it puts everything in ASC order (1234555666) and i can't sort it > again to display as DESC order (6665554321),
>
> what could be causing this?


Did you switch your sorting expression like below ?

"ColumnFOO" - "ColumnFOO Desc"

If you could post your grd_SortCommand I could help more
- Oytun YILMAZ

.

Nov 18 '05 #3
On Wed, 18 Aug 2004 06:19:09 -0700, IGotYourDotNet wrote:
I'm only doing
sub datagrid1_sortcommand()
bindGrid(e.sortExpression)
end sub

the bindGird calls Stored Procedures to bind the datagrid

Its sorts the grid, sort of, i need in asc and desc when I click the column.

"Oytun YILMAZ" wrote:
On Wed, 18 Aug 2004 05:59:01 -0700, IGotYourDotNet wrote:
I'm trying to sort my grid and its working halfway, I can only sort the grid
once and it puts everything in ASC order (1234555666) and i can't sort it
again to display as DESC order (6665554321),

what could be causing this?


Did you switch your sorting expression like below ?

"ColumnFOO" - "ColumnFOO Desc"

If you could post your grd_SortCommand I could help more

- Oytun YILMAZ


if your column name is FOO then you always call bindGird("FOO") You should
change your bindfunction place another parameter and a viewstate to keep
your last sort order like this:

sub datagrid1_sortcommand()
if viewstate("LastSort")="ASC"
bindGrid(e.sortExpression,"DESC")
viewstate("LastSort")="DESC"
elseif viewstate("LastSort")="DESC"
bindGrid(e.sortExpression,"ASC")
viewstate("LastSort")="ASC"
end sub
Nov 18 '05 #4
so i would have to create a new SP to allow for this?
The SP currenty returns the data in DESC order.

when i sort it, it makes the columns in ASC order which is fine, but if i
try and sort it again for DESC order nothing happens. So does the SP need to
allow this in it as a input or no?

"tribal" wrote:

the stored procedure needs to do the asc and desc

select *
from emp e
order by @column_name // pass the column name to sort
asc

you can then return the sorted result

hope this helps
-----Original Message-----
I'm only doing
sub datagrid1_sortcommand()
bindGrid(e.sortExpression)
end sub

the bindGird calls Stored Procedures to bind the datagrid

Its sorts the grid, sort of, i need in asc and desc when

I click the column.



"Oytun YILMAZ" wrote:
On Wed, 18 Aug 2004 05:59:01 -0700, IGotYourDotNet wrote:
> I'm trying to sort my grid and its working halfway, I can only sort the grid > once and it puts everything in ASC order (1234555666) and i can't sort it > again to display as DESC order (6665554321),
>
> what could be causing this?

Did you switch your sorting expression like below ?

"ColumnFOO" - "ColumnFOO Desc"

If you could post your grd_SortCommand I could help more
- Oytun YILMAZ

.

Nov 18 '05 #5

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

Similar topics

4
by: Bruce Pullum | last post by:
I have a datagrid that I am using a DataView with. All works great for the sorting of the columns. However, after I sort the column, and then try and select a data row to edit, the row selected...
11
by: James P. | last post by:
Hello, I have a report with the Priority field is used as sort order and grouping. The problem is the data in this Priority field if sorted in ascending order is: High, Low, and Medium. How...
4
by: Nhmiller | last post by:
This is directly from Access' Help: "About designing a query When you open a query in Design view, or open a form, report, or datasheet and show the Advanced Filter/Sort window (Advanced...
4
by: DancnDude | last post by:
I have a class that needs to have several different kinds of sorting routines on an ArrayList that it needs to conditionally do based upon the data. I have successfully created a class that...
5
by: Ingo Brueckl | last post by:
I need to declare a fixed array of (already defined and working) sort functions (sortfunc1, sortfunc2, sortfunc3) to pass one element of the array to qsort itself: int index; ??? func =...
1
by: aarklon | last post by:
Hi folks, this is the program implementing quicksort #include<stdio.h> #include<stdlib.h> #define swap(a,b){int t; t=a;a=b;b=t;} int partition(int,int,int); void quicksort(int,int,int);
1
by: Smokey Grindle | last post by:
does anyone know of a good example of asp.net 2.0's gridview showing a sort order arrow in the column header correctly and working? I cant seem to get what ive found on google to work (see previous...
0
by: rmgalante | last post by:
Hi, I've been experimenting with the ASP.Net GridView and encountered some interesting issues that I thought I would share. I have a page that loads a GridView with a generic collection of...
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
Can someone confirm if my no spam alias is set up correctly to get answers to questions. I have been talking to the concierge for over a week to get an answer to a question. Each time I am told to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.