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 August 24th, 2005, 09:57 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
Default Populating dropdowns

I have several dropdowns which I have bound it to a dataset this has worked, but I would like the form to be able to load with a null string not the first line of the dataset, I can't add a fake record to the dataset so how do I do it, as it is proving a problem when the user wants the functionality of not picking anything in the list. I have tried making the dropname.selectedvaue = "", but this falls over and I have also tried dropname.datatextfiled = "" on the page load.

Thanks Louisa


 
Old August 24th, 2005, 01:24 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

What do you mean it falls over? That is the correct way to add a blank. You just need to insert it at positon 0 and select it:

dropdown.Items.Insert(0, "")
dropdown.selectedindex = 0
 
Old August 31st, 2005, 06:33 AM
Authorized User
 
Join Date: Aug 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

u can use this statement to add blanklist item in to ur dropdown which is bound with dataset but use it after the statement of bounding.

DropDownList1.Items.Add(New ListItem(""))


dkautilya
[email protected]
 
Old August 31st, 2005, 07:40 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks - Working now






Similar Threads
Thread Thread Starter Forum Replies Last Post
selection with two or more linked dropdowns swifty_programmer ASP.NET 2.0 Basics 3 July 26th, 2007 10:44 AM
Populating dropdowns client-side. anup_daware General .NET 0 June 20th, 2006 04:17 AM
Dynamic Dropdowns jasmine_vj Classic ASP Basics 2 April 17th, 2006 12:47 PM
Dropdowns in datagrid amithkiran ASP.NET 1.x and 2.0 Application Design 1 March 24th, 2005 05:33 AM
Three dropdowns, one depended on another. Possible gilgalbiblewheel Classic ASP Databases 2 December 26th, 2004 05:59 PM





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