Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Drop Down menu - A-Z?

Author  Topic 

Richy1
Starting Member

27 Posts

Posted - 2007-05-21 : 05:35:08
Hi all, im using the excellent "Create Data-Driven Web Sites? (13:41)" video in ASP.net, and all works as it should do. Only thing is - when the drop down menu appears and a list of the "States", is there some way so that the States are listed from A-Z? Im sure there must be a way. but not sure how, thx.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-21 : 05:43:46
sort the datasource.


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Richy1
Starting Member

27 Posts

Posted - 2007-05-21 : 06:40:48
thanks, can u just explain that a little bit more?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-21 : 07:50:32
well what is your datasource for the combobox?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Richy1
Starting Member

27 Posts

Posted - 2007-05-21 : 09:01:08
Its exactly the same here - http://www.asp.net/learn/videos/view.aspx?tabid=63&id=49

As for the datasource, when i right click I have "Select a data source - objectDataSource. Select a data field in the DropDownList - State. Select a data field for the value of the DropDownList - State.

As for the configure Data source, quite alot of data there......but its exactly the same as the link above....

All i need is just to have the drop down list in an A-Z format? thx
Go to Top of Page

jhermiz

3564 Posts

Posted - 2007-05-21 : 14:28:54
quote:
Originally posted by Richy1

Its exactly the same here - http://www.asp.net/learn/videos/view.aspx?tabid=63&id=49

As for the datasource, when i right click I have "Select a data source - objectDataSource. Select a data field in the DropDownList - State. Select a data field for the value of the DropDownList - State.

As for the configure Data source, quite alot of data there......but its exactly the same as the link above....

All i need is just to have the drop down list in an A-Z format? thx



On the video it shows a query that inserts data from the PUB database into this so called Authors table. Then all you need to do is order by the field name that you would like.

The select is to Select * FROM Authors..
so add to it an ORDER BY Clause by saying
SELECT * FROM Authors ORDER BY [FieldYouWantToSortBy].

Programmers HowTo's -- [url]http://jhermiz.googlepages.com[/url]
Go to Top of Page

Richy1
Starting Member

27 Posts

Posted - 2007-05-22 : 09:02:54
Yep, it works thanks :)
Go to Top of Page
   

- Advertisement -