473,836 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Two way sorting in GridView using Object Data Source

Ram
Hi All,

I am using Object Data Source to bind data in the gridview. I have
set the property AllowSorting=tr ue. While running the application, I
could sort the data only in ascending order. Is there any way to
achieve two way sorting in gridview ie. both ascending and descending
on successive clicks ?.

Please give me a suggestion to solve this issue. Thanks in advance.
Expecting u'r answers,

S.Ramalingam

May 23 '06 #1
1 2906
On 22 May 2006 20:28:51 -0700, "Ram" <li*******@gmai l.com> wrote:
Hi All,

I am using Object Data Source to bind data in the gridview. I have
set the property AllowSorting=tr ue. While running the application, I
could sort the data only in ascending order. Is there any way to
achieve two way sorting in gridview ie. both ascending and descending
on successive clicks ?.

Please give me a suggestion to solve this issue. Thanks in advance.
Expecting u'r answers,

S.Ramalingam


Yes you can. Take a look at the ObjectDataSourc e I develop in my
article at the following post. (on MSDN also) It shows how to use ODS
for both directions of sorting. It's got an example and explanation.

Very powerful!

http://peterkellner.net/?p=24
Peter Kellner
http://peterkellner.net
May 23 '06 #2

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

Similar topics

0
1319
by: Dorte | last post by:
Hi, I use the gridview control to display data. I use a dataadapter to fill a datatable from an SQL server - the command is a stored procedure. Furthermore I have a couple of template columns (one with a "Lookup" function that displays customized data in the column). When using the gridview built in support for sorting, data should be selected by using a datasource object, with a SQL command specified as text (not a stored procedure)...
1
3694
by: ŘuGvEd | last post by:
Here is the error: direct link to erro image : http://img473.imageshack.us/img473/1666/untitled2pp.jpg Hi, I have a gridview control on the page which is bound to business object via objectdatasource and i m using collection to bring all my data on page. This used to work fine in beta version and no coding was changed. In RTM version
5
3379
by: yefei | last post by:
In my web design, I display records from a SQL DataBase according to some filters the GridView is defined with select commands and selest parameters however, I also want to display all records in the database when the user press a "View All" button. In this case, I need to change the select comand and clear the parameters. And I did this in the button_click() event. the GridView can display desired results when I press the "View All"...
1
3534
by: jmdolinger | last post by:
Hi all, I'm a newbie to Atlas (and recently ASP.NET) after coming from a long Java background, also have done quite a bit with an Ajax.NET/ASP.NET 1.1 project, but it was basically all javascript, nothing really having to do with ASP.NET... I'm attempting to put together an application that consists of several GridView controls each bound to some xml data. Each table exists in its own update panel. The two effects I'm going for are:
4
5485
by: kurt sune | last post by:
I have a an aspx page with a gridview. The gridview is data bound to a generic list of custom classes. The gridview's DataSource is thus not set. Now I want to add sorting to it. So I create an eventhandler thus: Protected Sub grdResult_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles grdResult.Sorting
4
26713
by: Tomasz Jastrzebski | last post by:
Hello Everyone, I have a GridView control bound to a plain DataTable object. AutoGenerateEditButton is set to true, Edit button gets displayed, and RowEditing event fires as expected.
2
3185
by: =?Utf-8?B?R2hpc3Rvcw==?= | last post by:
Hi, I have an ObjectDataSource bind to a GridView and Sorting is enabled. I have no problem with sorting, I implemented IComparer but I don't want to fetch my data each time from my database. I'm new with web development so I don't know if I do it right. What I do right now is putting my object in Cache, when the user sort the data, I retrieve my object from the cache and do the sort on the object.
2
1389
by: mahesh123 | last post by:
Hi, I am using gridview in my form and binded the gridview with object datasource.I am trying to implement sorting for my grid view and i am getting following error.i am using asp.net with VB Server Error in '/' Application. -------------------------------------------------------------------------------- The data source 'objdsDataSource' does not support sorting with IEnumerable data. Automatic sorting is only supported with...
1
2973
by: dorandoran | last post by:
The sort on the childgrid is not working; nothing happens when I click on the each column header for sort. (I followed Satay's sample: http://www.codeproject.com/KB/aspnet/EditNestedGridView.aspx) and i am using object for datasource. please suggest. = = = default.aspx = = <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
0
9812
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9658
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10533
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10579
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10244
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9362
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6975
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
4003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3103
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.