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.comw rote in message
news:8r******** *********@text. news.blueyonder .co.uk...
>
"Karl Seguin" <ka********@rem oveopenmymindre movemetoo.andme netwrote in
message news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>Unfortunetly , you're best bet will be to add this value in codebehind...
myDropDown.Ite ms.Insert(0, New ListItem("", 0))
Karl
I have used your example to try and do the auto list:
=============== =============== ====
protected override void OnLoad(EventArg s e)
{
int a = 0;
while (a < 100)
{
MyDropDown.Item s.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.