<asp:GridView ID="GridView2" runat="server" AllowPaging="True" AutoGenerateColumns="False"
DataSourceID="SqlDataSource4" Width="352px">
<Columns>
<asp:BoundField DataField="TeacherName" HeaderText="TeacherName" SortExpression="TeacherName" />
<asp:BoundField DataField="CourseId" HeaderText="CourseId" ReadOnly="True" SortExpression="CourseId" />
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
图如下:
我是想用一个自定义ItemTemplate来添加了一个Button来实现获取当前行的两个数值的.但不知道Button的事件怎么写?
希望各位帮帮忙.
谢谢了!!!