473,513 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sort gridview

I have a grid on my webform with 10 columns, I need to allow the user to sort
the columns when they click on the header. My grid is populated byt a dataset
and not any typed datasets, sqlobjectdatasource, etc. I've looked in some of
the asp.net 2005 books i have on this and the examples dont' work. can
someone show me a working code snippet of sorting a gridview?
Aug 17 '06 #1
4 1445
This code snippet should help..

http://www.netomatix.com/development...ewSorting.aspx

"CSharpguy" <CS*******@discussions.microsoft.comwrote in message
news:A1**********************************@microsof t.com...
>I have a grid on my webform with 10 columns, I need to allow the user to
sort
the columns when they click on the header. My grid is populated byt a
dataset
and not any typed datasets, sqlobjectdatasource, etc. I've looked in some
of
the asp.net 2005 books i have on this and the examples dont' work. can
someone show me a working code snippet of sorting a gridview?

Aug 17 '06 #2
thats one of the examples I tried, its the last one I tried before posting
and I can't get it to work. nothing happens.

AllowSorting = true
I have my fields as sortExpressions and nothing. It will not sort

"Winista" wrote:
This code snippet should help..

http://www.netomatix.com/development...ewSorting.aspx

"CSharpguy" <CS*******@discussions.microsoft.comwrote in message
news:A1**********************************@microsof t.com...
I have a grid on my webform with 10 columns, I need to allow the user to
sort
the columns when they click on the header. My grid is populated byt a
dataset
and not any typed datasets, sqlobjectdatasource, etc. I've looked in some
of
the asp.net 2005 books i have on this and the examples dont' work. can
someone show me a working code snippet of sorting a gridview?


Aug 17 '06 #3
Did you donwload the sample and tried it as such? Did that work?

Are you handling the sorting events in your code?

"CSharpguy" <CS*******@discussions.microsoft.comwrote in message
news:60**********************************@microsof t.com...
thats one of the examples I tried, its the last one I tried before posting
and I can't get it to work. nothing happens.

AllowSorting = true
I have my fields as sortExpressions and nothing. It will not sort

"Winista" wrote:
>This code snippet should help..

http://www.netomatix.com/development...ewSorting.aspx

"CSharpguy" <CS*******@discussions.microsoft.comwrote in message
news:A1**********************************@microso ft.com...
>I have a grid on my webform with 10 columns, I need to allow the user to
sort
the columns when they click on the header. My grid is populated byt a
dataset
and not any typed datasets, sqlobjectdatasource, etc. I've looked in
some
of
the asp.net 2005 books i have on this and the examples dont' work. can
someone show me a working code snippet of sorting a gridview?



Aug 17 '06 #4
yeah i downloaded and no it didn't work

"Winista" wrote:
Did you donwload the sample and tried it as such? Did that work?

Are you handling the sorting events in your code?

"CSharpguy" <CS*******@discussions.microsoft.comwrote in message
news:60**********************************@microsof t.com...
thats one of the examples I tried, its the last one I tried before posting
and I can't get it to work. nothing happens.

AllowSorting = true
I have my fields as sortExpressions and nothing. It will not sort

"Winista" wrote:
This code snippet should help..

http://www.netomatix.com/development...ewSorting.aspx

"CSharpguy" <CS*******@discussions.microsoft.comwrote in message
news:A1**********************************@microsof t.com...
I have a grid on my webform with 10 columns, I need to allow the user to
sort
the columns when they click on the header. My grid is populated byt a
dataset
and not any typed datasets, sqlobjectdatasource, etc. I've looked in
some
of
the asp.net 2005 books i have on this and the examples dont' work. can
someone show me a working code snippet of sorting a gridview?


Aug 17 '06 #5

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

Similar topics

2
5989
by: Daves | last post by:
I have a gridview displaying News items and fetches the data through a (little complicated) sql stored procedure... The sorting seems to be done in the gridview since there is no sorting...
3
6933
by: Thirsty Traveler | last post by:
I have a gridview where the datasource is bound after a selection. The result of doing this is that sorting and paging do not work. I was given a sample of how to resolve this, however my attempt...
1
3550
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
979
by: CSharpguy | last post by:
I'm using a master page in my web app. On my content pages I have the gridview and I need to able to sort the grid. I can sort the grid fine if its not in a master page, but when I put it in a...
0
921
by: Ryan H | last post by:
Hi, If I call GridView.Sort("MyColumn1, MyColumn2", SortDirection.Descending), I assume that the sort order will be equivalent to the SQL statement "...ORDER BY MyColumn2 DESC, MyColumn1 DESC"....
0
4810
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...
12
3783
by: Cindy Lee | last post by:
When I do a sorta on 1 table, then the other table goes back to the original order. What can I set so, it keeps the order of the other current gridview's order. I set all the gridview values...
0
2165
by: GMartin | last post by:
I have a pop-up form with a three columned Grid that has checkboxes in a Template Column in the first/left-most column. (The form is to allow users to select "Members" of a group, where they check...
2
5357
by: gnewsgroup | last post by:
I have a GridView, in which the header of one column changes depending on the selected value of a DropDownList outside of this GridView. I did this dynamic header through protected void...
3
5220
by: Peter | last post by:
I have a GridView which is populated by List<ofObjects> Does anyone have example of how to sort the columns of this GridView? I have found examples without DataSourceControl but these use...
0
7267
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
7175
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
7553
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...
1
7120
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
5697
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,...
0
4754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3247
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.