我有一个 Gridview。我在每一行上放置了复选框。通过选择复选框并单击删除按钮,我应该在代码隐藏中获取该 gridview 的所有选定行。请帮助我...
<asp:GridView ID="GridView1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" style="margin-left: 58px; margin-top: 13px" >
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<Columns>
<asp:TemplateField>
<EditItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Button ID="Delete" runat="server" Text="Button" runat="server"
onclick="Delete_Click" />
代码隐藏
protected void Button1_Click(object sender, EventArgs e)
{
string valueForDB = DatabaseList.SelectedValue;
Data obj = new Data();
if (valueForDB == "virtualworkplace")
{
obj.getDocforVirtualwrkspace(valueForDB);
GridView1.DataSource = obj.getDocforVirtualwrkspace(valueForDB);
GridView1.DataBind();
}
What to write here???
protected void Delete_Click(object sender, EventArgs e)
{
}