Home All Groups Group Topic Archive Search About

Drop down list not updating on pastback

Author
7 Nov 2007 10:55 PM
Randy Galliano
Hello,

I have a form with a drop down list bound to a data source which points
to table A.  There is a details form that queries the current value of
the drop down list and presents the data in Table A, with a new, delete,
and update button.

If I go and delete an entry in table a through the details form, the
drop down list still has the deleted entry in it.

How to I refresh the data source, force the drop down list to bind to
the refreshed data source so the next time somebody picks a value it
will be missing the deleted record from the dropdown list?

I have attached an example.

Regards,

Randy.

Author
12 Nov 2007 1:21 PM
Riki
Randy Galliano wrote:
Show quote
> Hello,
>
> I have a form with a drop down list bound to a data source which
> points to table A.  There is a details form that queries the current
> value of the drop down list and presents the data in Table A, with a
> new, delete, and update button.
>
> If I go and delete an entry in table a through the details form, the
> drop down list still has the deleted entry in it.
>
> How to I refresh the data source, force the drop down list to bind to
> the refreshed data source so the next time somebody picks a value it
> will be missing the deleted record from the dropdown list?
>
> I have attached an example.
>
> Regards,
>
> Randy.

Handle the OnItemDeleted event on the Detailsview.
There, add the line:
DropDownList1.DataBind()

--

Riki

AddThis Social Bookmark Button