日期:2014-05-18  浏览次数:20406 次

关于DATAGRID删除多行的问题,最好“孟子E章”看到后请进来,我是看了你的文章,谢谢!
前台:
<%@   Page   language= "c# "   Codebehind= "DataGridCheckBox.aspx.cs "   AutoEventWireup= "false "   Inherits= "eMeng.Exam.DataGridCheckBox.DataGridCheckBox "   %>
<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.0   Transitional//EN "   >
<HTML>
<HEAD>
<title> 为DataGrid添加CheckBox控件的例子 </title>
</HEAD>
<body>
<form   id= "frmMain "   method= "post "   runat= "server ">
<asp:datagrid   id= "dgMain "   runat= "server "   PageSize= "5 "   AllowPaging= "True "   Width= "98% "   AutoGenerateColumns= "False "
Font-Size= "9pt "   Font-Names= "宋体 "   DataKeyField= "au_id ">
<AlternatingItemStyle   ForeColor= "ControlText "   BackColor= "White "> </AlternatingItemStyle>
<ItemStyle   ForeColor= "ControlText "   BackColor= "WhiteSmoke "> </ItemStyle>
<HeaderStyle   Font-Bold= "True "   HorizontalAlign= "Center "   ForeColor= "Black "   VerticalAlign= "Middle "
BackColor= "Control "> </HeaderStyle>
<Columns>
<asp:TemplateColumn   HeaderText= "选项 ">
<HeaderStyle   HorizontalAlign= "Center "   Width= "50px "> </HeaderStyle>
<ItemTemplate>
<INPUT   id=SelectedID   type=hidden   value= ' <%#   Server.HtmlEncode((string)DataBinder.Eval(Container.DataItem,   "au_id "))%> '   name=SelectedID   runat= "server ">
<asp:CheckBox   id= "chkExport "   Runat= "server "> </asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn   DataField= "au_id "   ReadOnly= "True "   HeaderText= "序号 ">
<HeaderStyle   Width= "50px "> </HeaderStyle>
</asp:BoundColumn>
<asp:TemplateColumn   SortExpression= "demo "   HeaderText= "标题 ">
<ItemTemplate>
<asp:Label   id=lblColumn   runat= "server "   Width= "80% "   Text= ' <%#   Server.HtmlEncode((string)DataBinder.Eval(Container.DataItem,   "au_lname "))%> '>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle   NextPageText= "上一页 "   PrevPageText= "下一页 "> </PagerStyle>
</asp:datagrid> <asp:button   id= "cmdSelectAll "   runat= "server "   Text= "全部选中 "> </asp:button> <asp:button   id= "cmdFindSelected "   runat= "server "   Text= "删除选中的项目 "> </asp:button> <br>
<asp:label   id= "Label1 "   runat= "server "> </asp:label>
<hr>
<asp:label   id= "Label2 "   runat= "server "> </asp:label> </form>
</body>
</HTML>