Hi,
I've done this before and for the life of me I can't remember how!
Basically I have a Gridview inside a repeater, and I want to handle the events from the gridview (Edit, Delete etc.) in the codebehind but I can't remember how!
Here is my repeater...
You can see an edit command in the gridview, but obviously when I click on it I get a .NET error "The GridView 'gvSections' fired event RowEditing which wasn't handled.".
I've done this before and for the life of me I can't remember how!
Basically I have a Gridview inside a repeater, and I want to handle the events from the gridview (Edit, Delete etc.) in the codebehind but I can't remember how!
Here is my repeater...
Code:
<asp:Repeater ID="rptrSections" runat="server">
<ItemTemplate>
<h3><%#Container.DataItem("Name")%></h3>
<asp:GridView ID="gvSections" runat="server" CssClass="GridView"
DataSource='<%#BindSubData(Container.DataItem("id")) %>' DataKeyNames="id" AutoGenerateColumns="false"
GridLines="none">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lbtnEdit" runat="server" CommandName="Edit" Text="Edit Section Name" CausesValidation="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Section Name">
<ItemTemplate>
<%#Container.DataItem("Name")%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ItemTemplate>
</asp:Repeater>
You can see an edit command in the gridview, but obviously when I click on it I get a .NET error "The GridView 'gvSections' fired event RowEditing which wasn't handled.".