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

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.

Dec 2 '05 #1
0 1265

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

Similar topics

4
by: Dan | last post by:
I'm databinding my DropDownList to a DataSet. How do I add a dummy record at the top of the combo box. In other words, suppose we are dealing with cars I want something like: <select...
2
by: Ashish Sharma | last post by:
I have a DropDownList inside a DataList on a page. I want to set the selectedindex property of the DropDownList to some value. I bind the DropDownList on the ItemCreated Event of the DataList. ...
1
by: Joe Gass | last post by:
I'd like to bind some xml to a dropdownlist <engines> <engine name="test1" id="1" /> <engine name="test2" id="2" /> </engines> If I do: ddlEngines.DataSource =...
2
by: Nathan Sokalski | last post by:
I have several DropDownList controls on my page that use databinding. However, I want to give users the option of selecting a choice such as "None Selected" or something else that shows they did...
0
by: Daniel Doyle | last post by:
Hello and apologies in advance for the amount of code in this post. I've also sent this message to the Sharepoint group, but thought that ASP.NET developers may also be able to help, even though...
4
by: Mark Waser | last post by:
I've discovered a very odd bug when attempting to put a dropdown list in a datagrid. In the page PreRender step, the selected index of the datagrid is successfully set during databinding. Yet,...
5
by: Mike | last post by:
In ASP.NET 2.0 I have a dropdownlist populated from a sqldatasource. The dropdownlist values are successfully populated from a database table. I would like to add the value "Select Company" which...
1
by: Anilsg | last post by:
Hi all, I have the DropDownList in the FormView,inside InsertTemplateField The data is binded in run time to it in codebehind page,FOr the First time the page is loaded the DropdownList is...
0
by: Anilsg | last post by:
Hi all, I have the DropDownList in the FormView,inside InsertTemplateField The data is binded in run time to it in codebehind page,FOr the First time the page is loaded the DropdownList...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.