Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firing events from nested gridview within repeater?

Status
Not open for further replies.

BlackRed

Programmer
Sep 20, 2006
12
GB
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...

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.".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top