F
ForYourConsternation
I'm trying to accomplish the equivalent of the code below, but with a
two-way data binding. GetReportsTo() will just return a default
selection in the case of a NULL DB entry. I thought I could just
replace Eval with Bind, but that gives me: "The name 'Bind' does not
exist in the current context."
Is it possible to do this in the control, or do I need to modify the
DataSource?
<EditItemTemplate>
<aspropDownList ID="DropDownList2" runat="server"
DataSourceID="SqlDataSource2" DataTextField="Name"
DataValueField="EmployeeID"
SelectedValue='<%# GetReportsTo(Eval("ReportsTo")) %>'
AppendDataBoundItems="True">
<asp:ListItem Selected="True" Value="0">(none)</
asp:ListItem>
</aspropDownList>
</EditItemTemplate>
two-way data binding. GetReportsTo() will just return a default
selection in the case of a NULL DB entry. I thought I could just
replace Eval with Bind, but that gives me: "The name 'Bind' does not
exist in the current context."
Is it possible to do this in the control, or do I need to modify the
DataSource?
<EditItemTemplate>
<aspropDownList ID="DropDownList2" runat="server"
DataSourceID="SqlDataSource2" DataTextField="Name"
DataValueField="EmployeeID"
SelectedValue='<%# GetReportsTo(Eval("ReportsTo")) %>'
AppendDataBoundItems="True">
<asp:ListItem Selected="True" Value="0">(none)</
asp:ListItem>
</aspropDownList>
</EditItemTemplate>