Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Sorting DropDownList In .NET 2.0 Databinding

 
Thread Tools Search this Thread
Old 12-02-2005, 11:31 AM   #1
Default 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
inconsistent!

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



Simon Gregory
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET 2.0 Web Apps / .NET 3.5 ASP.NET Apps - Differences/Similariti london1919 MCTS 1 12-08-2008 03:16 PM
Exam strategy and references for MCTS .net (536+528)/how to prepare gravz84 MCTS 0 06-20-2008 11:32 AM
RE: .NET 3.0 Certification / Exams Joel MCTS 1 03-28-2007 03:05 AM
RE: .NET 3.0 Certification / Exams Joel MCITP 1 03-28-2007 03:05 AM
RE: .NET 3.0 Certification / Exams swapnil2006 MCTS 0 12-22-2006 10:23 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46