471,088 Members | 1,267 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,088 software developers and data experts.

Dropdown in Formview not updating as expected

Hi all,

== brief version ==

using ASP 2.0, I have a ddl inside a formview. On update, if the ddl starts
as NULL, no update happens. If the ddl has a bound value that is not NULL,
then all updates happen as expected.

How do I resolve this pleeeaase??!! :-)
== detailed version ==

using ASP 2.0, I have the following scenario representing systems with a
status on each one. So we have a FormView (say fvSystem) bound to a
SQLDataSource (say sdsSystem) containing a dropdownlist (say ddlStatus)
containing values from another SQLDataSource (say sdsStatus), with its
SelectedValue bound to an ID field (say StatusID) in fvSystem (using


FormView (fvSystem) =(datasource) sdsSystem, which contains:
DropDownList (ddlStatus) =(datasource) sdsStatus, bound to StatusID
(from fvSystem).

In sdsSystem, StatusID is often null so the ddl looks like:

<asp:DropDownList ID="ddlStatus" runat="server"
DataTextField="Status" DataValueField="StatusID"
SelectedValue='<%# Bind("StatusID") %>'
<asp:ListItem Value="">(No selection)</asp:ListItem>

Much of the operation is perfect:

- when StatusID is null, the ddl displays the "(No selection)" item as
- on update, if StatusID is not null, all changes are updated correctly
(including choosing "(No selection)".

However, on Update (during an Edit), if StatusID starts as a null value,
changing the selection always returns a null.

This has almost made me go bald and I'm sure it's an easy fix. If anyone
can help (I've Googled myself silly here) I would be extremely grateful.

Many regards,
Dave E (Sydney)
Dec 2 '06 #1
1 1323
After some thinking, I've worked it out. I had optimistic concurrency set
on sdsStatus.

Removed "AND @original_StatusID = [StatusID]" from the UpdateCommand for
sdsSystem and Bob was my Aunty!!

Hope this may help anyone reading... tough one to crack for me.

Dave E (Sydney)
Dec 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jerome | last post: by
3 posts views Thread by J055 | last post: by
reply views Thread by =?Utf-8?B?TGFkaXNsYXYgTXJua2E=?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.