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

GridView and ObjectDataSource Sorting

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.

It working well right now but I'm the only one to test the site.

My question is, using the Cache is it the good thing to do. It is per user
request and I'm not sure that Cache is for only one user...

Help me please, I will send you a real tasty Canadian Beer :o)
Jul 12 '07 #1
2 3134
You should be able to specify Caching directly on the ObjectDataSource control.
Pete
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com

"Ghistos" wrote:
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.

It working well right now but I'm the only one to test the site.

My question is, using the Cache is it the good thing to do. It is per user
request and I'm not sure that Cache is for only one user...

Help me please, I will send you a real tasty Canadian Beer :o)

Jul 12 '07 #2
The data source 'ObjectDataSource2' does not support sorting with IEnumerable
data. Automatic sorting is only supported with DataView, DataTable, and
DataSet

This is what happen when I turn EnableCache when I work with custom object...
"Peter Bromberg [C# MVP]" wrote:
You should be able to specify Caching directly on the ObjectDataSource control.
Pete
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com

"Ghistos" wrote:
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.

It working well right now but I'm the only one to test the site.

My question is, using the Cache is it the good thing to do. It is per user
request and I'm not sure that Cache is for only one user...

Help me please, I will send you a real tasty Canadian Beer :o)
Jul 12 '07 #3

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

Similar topics

1
by: Arjen | last post by:
Hi, I databind my gridview like this: GridView1.DataSource = Membership.GetAllUsers(); // asp.net 2.0 (MembershipUserCollection) GridView1.DataBind(); When I try to sort the gridview I get...
1
by: sloan | last post by:
Ok, I've gotten somewhat handy with the new GridView. And I have it bound to a business object datasource, via the ObjectDataSource. Lets say I have 3 databound columns EmpID,...
0
by: ferherra | last post by:
Hi, Hope someone can help... I databind my gridview (asp.net 2.0) like this: GridView1.DataSource = Membership.GetAllUsers(); (MembershipUserCollection) GridView1.DataBind(); In the...
1
by: syl | last post by:
Hello I am trying to create a "easy to use" gridview with filters (dropdownlist in headers), sorting...and much more.... In order to do that, i prefer to use a objectdatasource (ODS) beacause...
4
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...
8
by: Greg Lyles | last post by:
Hi all, I'm trying to develop an ASP.NET 2.0 website and am running into some real problems with what I thought would be a relatively simple thing to do. In a nutshell, I'm stuck on trying to...
3
by: Marc Grutte | last post by:
Hi I am trying to bind a custom datasource to a gridview whilst paging is enabled. What is missing in this code to make the paging + binding work? thanks M <%@ Page Language="VB" %>
0
by: pargat.singh | last post by:
Hi: I am using a grid and having a problem with sorting. Below are my code and change the header name at run time as below based on language.If i don't change the header name it work. Can...
2
by: Aamir Ghanchi | last post by:
hi, I have a gridview which is bound to ObjectDataSource which in turn reads from a business objects methods for custom paged data. When PageIndex is set to any value other than 0 and one of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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...
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,...
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
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...

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.