![]() |
|
|
|||||||
![]() |
ASP Net - Sorting DropDownList In .NET 2.0 Databinding |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |