D
Dave E
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
sdsSystem).
Pseud-schematically:
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:
<aspropDownList ID="ddlStatus" runat="server"
DataSourceID="sdsStatus"
DataTextField="Status" DataValueField="StatusID"
SelectedValue='<%# Bind("StatusID") %>'
AppendDataBoundItems="True">
<asp:ListItem Value="">(No selection)</asp:ListItem>
</aspropDownList>
Much of the operation is perfect:
- when StatusID is null, the ddl displays the "(No selection)" item as
expected,
- 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)
== 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
sdsSystem).
Pseud-schematically:
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:
<aspropDownList ID="ddlStatus" runat="server"
DataSourceID="sdsStatus"
DataTextField="Status" DataValueField="StatusID"
SelectedValue='<%# Bind("StatusID") %>'
AppendDataBoundItems="True">
<asp:ListItem Value="">(No selection)</asp:ListItem>
</aspropDownList>
Much of the operation is perfect:
- when StatusID is null, the ddl displays the "(No selection)" item as
expected,
- 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)