开发者

Listview edit mode

开发者 https://www.devze.com 2023-01-06 10:59 出处:网络
I am currently using a listview WITHOUT a data control.When i click on the edit button the listview will not enter edit mode. Any help would be appreciated, thank you very much

I am currently using a listview WITHOUT a data control.When i click on the edit button the listview will not enter edit mode. Any help would be appreciated, thank you very much

        <asp:ListView ID="Lv_Test" runat="server" InsertItemPosition="FirstItem"
            OnItemEditing="Lv_TestItemEditing">
            <LayoutTemplate>
                <table cellpadding="0" cellspacing="0" widt开发者_运维问答h="345px">
                    <th>
                    </th>
                    <th>
                        <asp:Label ID="headerTest" runat="server" Text="headerTest" />
                    </th>
                    <tr>
                        <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
                    </tr>
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <tr>
                    <td">
                        <asp:Button runat="server" ID="btnEditTest" Text="EditTest" CommandName="Edit" />
                    </td>
                    <td class="formFieldText">
                        <asp:Label ID="testLabel" runat="server" Text='<% #Eval("name") %>'></asp:Label>
                    </td>
                </tr>
            </ItemTemplate>
            <EditItemTemplate>
                <tr>
                    <td>
                        <asp:Button runat="server" ID="btnEditr" Text="Update" />
                    </td>
                    <td>
                    in edit mode
                    </td>
                </tr>
                                </EditItemTemplate>
        </asp:ListView>

Protected Sub Lv_TestItemEditing(ByVal sender As Object, ByVal e As ListViewEditEventArgs)

End Sub


In the ListView HTML, you have OnItemEditing="Lv_TestItemEditing". But the name of the event you show is ListView_grantorItemEditing. The event names should match.


Lv_Test.editindex = e.neweditindex lv_grantee.databind()

needed to be in protected sub lv_testitemediting

0

精彩评论

暂无评论...
验证码 换一张
取 消