you could do a+=100
but a for loop is probably better for what you want (only a bit though...no
big deal if you prefer a while loop...)
Also, you can use Add instead of Insert (insert places it at the index
specified in the first parameter...my guess is you just wanna append them
one after another)
for (int i = 100; i < 10000; i+=100)
{
MyDropDow.Items.Add(i.ToString());
}
I started at 100 'cuz that's what your example looked like you wanted...you
could do int i = 0 if you want a 0 in there...
also note that I'm not creating a new ListItem, the Add method also accepts
a single string when the text and value are the same thing...just a
convinience...
Karl
--
http://www.openmymind.net/ http://www.codebetter.com/
"Badass Scotsman" <ba****@yo.comwrote in message
news:8r*****************@text.news.blueyonder.co.u k...
>
"Karl Seguin" <ka********@removeopenmymindremovemetoo.andmenetwr ote in
message news:%2****************@TK2MSFTNGP06.phx.gbl...
>Unfortunetly, you're best bet will be to add this value in codebehind...
myDropDown.Items.Insert(0, New ListItem("", 0))
Karl
I have used your example to try and do the auto list:
==================================
protected override void OnLoad(EventArgs e)
{
int a = 0;
while (a < 100)
{
MyDropDown.Items.Insert(0, new ListItem(""+a+"", ""+a+""));
a++;
}
}
==================================
Do you know how I might go about increasing by an increment of 100 at a
time instead of 1?
New to .NET.
Ta,
Gary.