Hi, I have a RadListBox that is being populated on Page_Load through a DataTable that comes from the DB. Problem is: when I try to iterate the ItemCollection (via the Items Property) the List has Count=1 (the first item), when it was supposed to be 20+(I don't know the exact item count). Below are the relevant snippets:
Here the list is iterated to find out what items are selected in the db and move them from this list to another.
protected
void
ListaPaisExp_ItemDataBound(
object
sender, RadListBoxItemEventArgs e)
{
foreach
(DataRow dr
in
Empresa.Tables[1].Rows)
{
foreach
(RadListBoxItem item
in
ListaPaisExp.Items)
{
if
(item.Value == dr[
"tipopaisid"
].ToString())
{
ListaPaisExpSel.Items.Add(item);
item.Remove();
}
}
}
}
And this is the DataBind on Page_Load:
ListaPaisExp.DataSource = Tipos_DAL.GetTiposByArchtype(
"pais"
);
ListaPaisExp.DataValueField =
"ID"
;
ListaPaisExp.DataTextField =
"Descricao"
;
ListaPaisExp.DataBind();