Dans un ASP .NET 3.5 ListView InsertItemTemplate Je voudrais changer une zone de texte:ASP .NET - Utilisation asp: ListBox dans ListView
<asp:TextBox ID="txt" runat="server" Text='<%# Bind("plant") %>' />
à un ListBox:
<asp:ListBox ID="list" runat="server" DataValueField='<%# Bind("plant") %>' >
Comment Dois-je lier le champ 'plante' à la liste?
MISE À JOUR 1
Voici un exemple d'utilisation d'un combobox avec la propriété SelectedValue:
<cc1:ComboBox ID="ComboBox1" AutoPostBack="false"
DropDownStyle="DropDownList" AutoCompleteMode="Suggest"
CaseSensitive="false" CssClass="AjaxToolkitStyle"
ItemInsertLocation="Append"
SelectedValue='<%# Bind("car") %>' runat="server">
<asp:ListItem>Porsche</asp:ListItem>
<asp:ListItem>VW</asp:ListItem>
<asp:ListItem>BMW</asp:ListItem>
<asp:ListItem>UNK</asp:ListItem>
</cc1:ComboBox>
SelectedValue est une propriété valide? Il n'apparaît pas dans la saisie semi-automatique IntelliSense. –
Il n'apparaît pas dans l'IntelliSense dans le balisage - mais il est valide. Idem pour DropDownList. –