473,387 Members | 1,812 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,387 software developers and data experts.

DropDownList Order

Hello,

Is it possible to alphabetically order the items in a DropDownList
after being added to it?

Thanks,
Miguel

Jan 9 '07 #1
8 1386
Maybe use an arraylist as the datasource and sort the arraylist.

"shapper" <md*****@gmail.comwrote in message
news:11*********************@42g2000cwt.googlegrou ps.com...
Hello,

Is it possible to alphabetically order the items in a DropDownList
after being added to it?

Thanks,
Miguel

Jan 9 '07 #2
"shapper" <md*****@gmail.comwrote in message
news:11*********************@42g2000cwt.googlegrou ps.com...
Is it possible to alphabetically order the items in a DropDownList
after being added to it?
Presumably, you mean client-side with JavaScript...?
http://www.google.co.uk/search?sourc...pt+SELECT+sort
Jan 9 '07 #3
Presumably, you mean client-side with JavaScript...?

Surely you should assume he means server-side with asp.net seeing as that is
what this group is :)
Jan 9 '07 #4
"Aidy" <ai**@noemail.xxxa.comwrote in message
news:Op*********************@bt.com...
>Presumably, you mean client-side with JavaScript...?

Surely you should assume he means server-side with asp.net seeing as that
is what this group is :)
LOL! In that case, he'd be interested in sorting the options *before* adding
them, wouldn't he...
Jan 9 '07 #5
"Milosz Skalecki [MCAD]" <mi*****@REMOVEITwp.plwrote in message
news:C5**********************************@microsof t.com...
IMHO Aidy was right, Shapper meant sorting after all the items after
manually adding/binding the source...
So explain to me why he wouldn't simply sort the datasource *before* binding
it...?
Jan 9 '07 #6
shapper wrote:
Hello,

Is it possible to alphabetically order the items in a DropDownList
after being added to it?

Thanks,
Miguel
If you've databound it to an sql datasource, do your sort in your select
statement. Othewise, the array sorting sounds like a good idea.
Jan 9 '07 #7
So explain to me why he wouldn't simply sort the datasource *before*
binding it...?
Because he doesn't fully understand data binding and is here looking for a
solution. Anyone who fully understood the issue would, of course, have
worded it a different way. When dealing with Qs you sometimes need to read
between the lines.
Jan 9 '07 #8
"Aidy" <ai**@noemail.xxxa.comwrote in message
news:2f*********************@bt.com...
When dealing with Qs you sometimes need to read between the lines.
Thanks for setting me straight on that.
Jan 9 '07 #9

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

Similar topics

0
by: DotNetJunkies User | last post by:
Hie, I create a dynamique HtmlTable, in each cell of this HtmlTable put a new control ( dropdownlist,label,..) and then want to create handler so that if i change the select item in the dop downlist...
2
by: Newbie | last post by:
I have a C# asp.net webform that contains a dropdownlist and a button that allows the user to select another item in the dropdownlist. The webform should work as follows: When the user selects...
5
by: DC Gringo | last post by:
I've got a command button to submit a value from a dropdown list that should then filter a SELECT query. I'm simply appending a WHERE colx = <variableSelectedFromDropdownList>. How do I pass this...
2
by: DC Gringo | last post by:
I have two dropdownlists where one is a set of districts and the other sub-districts. Upon choosing a district in the first dropdownlist, I need the relevant subdistricts to show in the second...
3
by: Assimalyst | last post by:
Hi, I'm attempting to populate a dropdownlist with data from a datareader. It works OK except whatever data is extracted as the very top line (Index = 0) cannot be seen in the dropdownlist. ...
4
by: Chris Kettenbach | last post by:
Good morning all, I am sure this has been asked but I did not see anything. I have a datalist control. In the edititemtemplate I have a dropdownlist. I know on the itemdatabound event is where I...
15
by: Swetha | last post by:
Hello I have a DropDownList that I am populating using the following SqlDataSource: <asp:DropDownList ID="parentIDDropDownList" runat="server" DataSourceID="SqlDataSource3"...
0
by: anyeone | last post by:
I'm finding articles all over the place saying how to bind a dropdownlist to an objectdatasource or sqldatasource in .NET 2.0/VS2005 but nothing that says how to get the selected value from another...
0
by: andy | last post by:
Hi, I have a form uses several dropdownlists to narrow a set of criteria. ( This is in turn used to control what is shown on a gridview. ) With each, the user selects an entry and then the next...
6
by: shashi shekhar singh | last post by:
Respected Sir, I have to create multiple dynamic dropdownlist boxes and add items dynamically in <asp:table> server control but problem occurs , i.e. except of fist dropdown list no dropdownlist...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.