Hi Mirnes,
You have to handle DataBound of the ListBox event and remove whatever you
don't need:
protected void ListBox1_DataBound(object sender, EventArgs e)
{
ListBox listBox = (ListBox)sender;
// there are two methods you can use
//ListItem listItem = listBox.Items.FindByText("ItemText");
// or
ListItem listItem = listBox.Items.FindByValue("3");
if (listItem != null)
{
listBox.Items.Remove(listItem);
}
}
hope this helps

Signature
Milosz
> I have a listbox which is populated from Sql query and I use it to add
> values to table. I would like to exclude value which just has been
> added from listbox. Since it is impossible to do in query which is
> datasource for query is there some other option.
Mirnes - 25 Jun 2007 07:59 GMT
Thanks for response, I'll try this.
Milosz Skalecki [ MCAD ] je napisao:
> Hi Mirnes,
>
[quoted text clipped - 22 lines]
> > added from listbox. Since it is impossible to do in query which is
> > datasource for query is there some other option.