Hi,
I have used several drop down list boxes for my program.
So far I have managed to get the information from SQLServer. However, I
have noticed that I keep getting one or two blank cells within my drop
down lists.
Really I would like to get rid of these blank cells in order to make the drop down lists look neat.
Does anyone know why this is happening and whether there is a solution to this problem?
Thanking you in advance
Loading
Posted Dec 13, 2007, 12:31 PM
int i = 0;
foreach (Item item in dropDownList.Items)
{
if(item.Text == String.Empty)
{
dropDownList.Items.RemoveAt(i);
}
i++;
}