Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 12th, 2004, 12:39 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default Drop Down List Add-On

I have a dropdown list bound to a data reader. I want to add a default, static entry as the first option.

I am using
Code:
myDDL.Items.Add(New ListItem("Select Type", "0"))
to add the static entry.

However, it is always the last item in the list. How do I make this the first option in the list?

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
 
Old February 12th, 2004, 12:45 PM
Authorized User
 
Join Date: Feb 2004
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

problem is not over here..
check you code nicely..
thanks


Aashish Shah
 
Old February 12th, 2004, 01:40 PM
Authorized User
 
Join Date: Jan 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

myDDL.Items.insert(0, "Select Type")

 
Old February 12th, 2004, 01:56 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Markie, that was mostly it.

Instead of:
Code:
myDDL.Items.insert(0, "Select Type")
I used:
Code:
myDDL.Items.insert(0, New ListItem("Select Type", "0"))
You da man, or woman, or Texan, or whatever

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add static text in drop down list vinodonline2000 ASP.NET 2.0 Basics 10 August 16th, 2007 12:39 AM
how to add tool tips for drop down list ? wlin ASP.NET 2.0 Basics 0 November 20th, 2006 04:12 PM
drop down list values based on another drop down noor ASP.NET 1.0 and 1.1 Basics 3 July 5th, 2005 09:57 AM
Drop Down List mrideout BOOK: Beginning ASP.NET 1.0 6 March 18th, 2005 03:32 AM
Drop Down List mrideout BOOK: Beginning ASP.NET 1.0 8 September 16th, 2004 07:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.