In my databound datagrid i have a databound dropdownlist, like this:
<asp:DropDownLi st ID="ddlAvail0" runat="server"
SelectedValue=' <%# Bind("AvailMon" ) %>'>
<asp:ListItem ></asp:ListItem>
<asp:ListItem Value="1">Yes</asp:ListItem>
<asp:ListItem Value="0">No</asp:ListItem>
</asp:DropDownLis t>
I would really prefer to use a checkbox, but because it doesn't have a 3rd
state for null I'm stuck using a dropdownlist.
Anyway, when the user is going to INSERT a new person the ddl defaults to
the first item, which is null.
Is there anyway to save 0 to the database automatically if the first
listitem is selected? I didn't have to write any code yet - just using the
designer.
I hope this makes sense.
Thanks for your advice!
<asp:DropDownLi st ID="ddlAvail0" runat="server"
SelectedValue=' <%# Bind("AvailMon" ) %>'>
<asp:ListItem ></asp:ListItem>
<asp:ListItem Value="1">Yes</asp:ListItem>
<asp:ListItem Value="0">No</asp:ListItem>
</asp:DropDownLis t>
I would really prefer to use a checkbox, but because it doesn't have a 3rd
state for null I'm stuck using a dropdownlist.
Anyway, when the user is going to INSERT a new person the ddl defaults to
the first item, which is null.
Is there anyway to save 0 to the database automatically if the first
listitem is selected? I didn't have to write any code yet - just using the
designer.
I hope this makes sense.
Thanks for your advice!
Comment