PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

Handling NULLs in a DropDownList EditItemTemplate

 
 
ForYourConsternation@yahoo.com
Guest
Posts: n/a
 
      24th Jul 2007
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>

 
Reply With Quote
 
 
 
 
ForYourConsternation@yahoo.com
Guest
Posts: n/a
 
      25th Jul 2007
On Jul 24, 3:37 pm, (E-Mail Removed) wrote:
> 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>


If this is just a stupid question, please say so. No one will reply
to this question anywhere.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid EditItemTemplate-- how to retrieve a DropDownList validator? Steve Hershoff Microsoft ASP .NET 2 11th Apr 2007 09:12 PM
No Value: DropDownlist in EditItemTemplate Gridview Problem =?Utf-8?B?ZGVuIDIwMDU=?= Microsoft ASP .NET 0 11th Oct 2006 12:34 PM
How to set selection in dropdownlist included in a Gridview <EditItemTemplate> WT Microsoft ASP .NET 2 3rd May 2006 03:59 PM
gridview: selected value of dropdownlist in edititemtemplate =?Utf-8?B?Tkg=?= Microsoft ASP .NET 2 27th Mar 2006 01:43 PM
DropDownList in EditItemTemplate George Durzi Microsoft ASP .NET 1 27th Sep 2004 06:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:03 PM.