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

2.0 Generic Collection & ObjectDataSource

Here is what I want and I can't seem to find it:

In asp.net 2.0 I want to create a generic collection that will perform
sorting and is capable of being used by the ObjectDataSource and eventually
bind to a GridView.

Are there any samples out there of this?
--
-Demetri
Nov 17 '05 #1
2 1709
Demetri,

Why not derive from List<T>? You can add a method to sort the items,
and then the items should be able to be passed to an ObjectDataSource
easily.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Demetri" <De*****@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
Here is what I want and I can't seem to find it:

In asp.net 2.0 I want to create a generic collection that will perform
sorting and is capable of being used by the ObjectDataSource and
eventually
bind to a GridView.

Are there any samples out there of this?
--
-Demetri

Nov 17 '05 #2
Demetri wrote:
Here is what I want and I can't seem to find it:

In asp.net 2.0 I want to create a generic collection that will
perform sorting and is capable of being used by the ObjectDataSource
and eventually bind to a GridView.

Are there any samples out there of this?


ObjectDataSource expects an object which exposes 4 methods: Select,
Update, Insert and Delete (or methods which perform these actions). So,
create _that_ object first, and let the Select method return the
collection you want to bind/sort. That then will allow you to bind the
actually collection at design time.

See also:
http://www.nikhilk.net/DataSourceCon...esignTime.aspx (part 5,
there are 4 other parts at that site, please read them all for more
information :))

Frans

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Nov 17 '05 #3

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

Similar topics

0
by: Peter Sestoft | last post by:
C5 is a comprehensive library of generic collection classes for the upcoming version 2.0 of the .Net platform (C#, VB.Net) C5 extends the standard System.Collections.Generic namespace with tree...
7
by: Paul Welter | last post by:
Is there anyway to do the following? Type myType = typeof(User); Collection<myType> list = new Collection<myType>(); I know I could just use User instead of myType but have a function that...
8
by: JAL | last post by:
Here is my first attempt at a deterministic collection using Generics, apologies for C#. I will try to convert to C++/cli. using System; using System.Collections.Generic; using System.Text; ...
2
by: dcew | last post by:
Here's what I'm trying to understand; how can you store a generic collection in a variable/field? If I have an abstract generic collection class as follows... public abstract class...
8
by: Steven Cummings | last post by:
Hello, I've scoured this usenet group and didn't find anything specific to my problem, so hopefully this won't be a repeated question. I'm all but certain it's not. I would like to *declare*...
1
by: Peter Sestoft | last post by:
We have just released C5, a library of generic collection classes for C# and other CLI languages, as found in Microsoft .Net version 2.0. C5 provides functionality and data structures not...
2
by: cylt | last post by:
Hi, I would like to have something like that : IList<IUser> list2 = list1 as IList<IUser>; where list1 is a generic collection of User ( IList list1<User>=new List<User>() ) and where User...
6
by: Lee Crabtree | last post by:
Pinning a regular managed array is pretty easy in C++/CLI, such as: if buffer is defined thusly: array<System::Byte^buffer pinning it would be something like: pin_ptr<unsigned charpinBuf =...
5
by: Ethan Strauss | last post by:
Hi, I have just started using Generic Collections for .Net 2.0 and so far they are working very nicely for me. But, I do have a couple of questions. If I have a Generic collection which has a type...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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
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.