tags:

views:

37

answers:

2

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" width="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
A: 

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.

DOK
I changed the sub name, It now matches to what the onItemEditing method name is. Still doesn't display the edit template
george9170
Perhaps it's a typo, but you have two G's at the end of Lv_TestItemEditingg in the event.
DOK
yup it was a typo, I have removed it
george9170
A: 

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

needed to be in protected sub lv_testitemediting

george9170