Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

drop down list in code behind

Posted on 2011-09-20
2
Medium Priority
?
244 Views
Last Modified: 2012-05-12
Hello,

I would like to populate my dropdown list in the code behind with numbers.

but i need it to count down in 0.5

so if a user has 7 days holiday i want to have the drop down menu go

7/6.5/6/5.5/5/4.5/4/3.5/3/2.5/2/1.5/1/0.5

and if the have 3 it would be 3/2.5/2/1.5/1/0.5
0
Comment
Question by:runnerjp2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
crisco96 earned 2000 total points
ID: 36566453
dim holidaydays as decimal = 7'7 or 3, not sure how you're setting this

'This assumes your dropDown is named daysDDL, change to whatever your actual ID is
While holidaydays > 0
	daysDDL.items.add(holidaydays)
	holidaydays -= 0.5
End While

Open in new window

0
 

Author Closing Comment

by:runnerjp2005
ID: 36566480
Perfect!!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question