468,321 Members | 1,848 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,321 developers. It's quick & easy.

Sorting DropDownList In .NET 2.0 Databinding

I am currently attempting to figure out how the new databinding
stucture works in ASP.NET 2.0 after working with v1.0 & v1.1 for
several years.

It seems that if you wish to do set up databinding at Design Time, you
are restricted to using one of the 5 xxxDataSource controls.

The data in our websites are usually obtained via a set of webservices
and are contained in a set of strongly typed relational DataSets.

In this case, the ObjectDataSource seems to be the control I need to
use, but it seems to have a high number of restrictions, especially in
relation to sorting the basic databound controls, such as the
DropDownList control.

In ASP.NET 1.0 & 1.1, all I needed to do to be able to databind these
controls to the respective dataset table (or data subset), was drop a
DataView control on the page and set the filter & sort parameters
respectively at design or runtime. However, it doesn't seem possible to
use the DataView as a design time control in 2.0.

In ASP 2.0, the ObjectDataSource is all that is available to act as a
binding layer between the control and the dataset, however there seems
no way to be able to set the sort with this control at design time.
Does this mean that we are now expected to hard code different methods
in the data layer to provide all the various sorting combinations for
each table that an entire site would need?!?

When using some of the other new controls (such as the GridView), you
can get it to easily instuct the ObjectDataSource to sort the undelying
DataTable by either enabling the AllowSorting property and let the user
select it or use the (runtime) Sort method - although this too
prohibits defining the Sorting at design time - but at least it's
possible to achieve fairly simply. The DropDownList control doesn't
even support a sort method which is both restrictive and seemingly

Surely I'm mssing something here, I thought 2.0 was supposed to make
databinding easier.

Dec 2 '05 #1
0 1114

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Dan | last post: by
2 posts views Thread by Ashish Sharma | last post: by
1 post views Thread by Joe Gass | last post: by
reply views Thread by Daniel Doyle | last post: by
4 posts views Thread by Mark Waser | last post: by
5 posts views Thread by Mike | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by howard w | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.