Gridview SelectedIndex value set
使用ASP.NET C。
1 2 3 4 5 6 7 8 9 10 | <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="CategoryID" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="GridView2_SelectedIndexChanged" OnRowCommand="GridView2_RowCommand"> <Columns> <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" InsertVisible="False" ReadOnly="True" SortExpression="CategoryID" /> </Columns> </asp:GridView> |
受保护的void gridview2_selectedIndexChanged(对象发送方,事件参数e){
1 | GridView2.FindControl("CategoryID").Text=2; |
}
希望在ridview2的selectedIndexChanged方法上更改所选列值。如何操作?
您可以通过