0
私はbutton
を持っています。これはDatalist
の上にあります。ユーザーが検索を行うたびに、返されたレコードはDatalist
にバインドされます。ボタンのASP.NET VBはデータリストを編集モードに設定します
コード: データリストのための<asp:Button ID="Button1" runat="server" Text="Edit" CommandName="edit"/>
コード:.vbファイルで
<asp:DataList ID="UserMatrixDataList" runat="server" RepeatColumns="1" CellSpacing="6" RepeatLayout="Table" BorderWidth="5">
<ItemTemplate>
<table class="table">
<col width="130">
<col width="800">
<tr>
<td>
<strong>Level</strong>
</td>
<td>
<asp:Label ID="lblLevel" runat="server" Text='<%# Eval("Level")%>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
<EditItemTemplate>
<table class="table">
col width="130">
<col width="800">
<tr>
<td>
<strong>Level</strong>
</td>
<td>
<asp:TextBox ID="txtLevel" runat="server" Text='<%# Eval("Level")%>'></asp:TextBox>
</td>
</tr>
</table>
</EditItemTemplate>
</asp:DataList>
、私が持っている:
はProtected Sub UserMatrixDataList_EditCommand(source As Object, e As DataListCommandEventArgs)
For i = 0 To UserMatrixDataList.Items.Count
UserMatrixDataList.EditItemIndex = e.Item.ItemIndex
UserMatrixDataList.DataBind()
Next
End Sub
しかし、何も上のクリックした後に起こりませんbutton
。私はそれを間違ってやっていますか?あるいは、そのような方法を実装することさえ可能ですか?
あなたのアドバイスありがとうございました! –