1
2
3
4
5
6
7
8
9
|
<Columns> <dx:GridViewCommandColumn ShowSelectCheckbox= "true"
VisibleIndex= "0"
Caption= "功能"
Name= "tool"
Width= "45" >
<ClearFilterButton Text= "清除筛选"
Visible= "True" >
</ClearFilterButton>
<HeaderTemplate>
<input type= "checkbox"
onclick= "grid.SelectAllRowsOnPage(this.checked);"
title= "选中或释放当前页面的记录"
/>
</HeaderTemplate>
</dx:GridViewCommandColumn>
|
设置ShowSelectCheckbox="true"
添加<HeaderTemplate>
<input
type="checkbox" onclick="grid.SelectAllRowsOnPage(this.checked);"
title="选中或释放当前页面的记录"
/>
</HeaderTemplate>
在页面放置一个 按钮, 按钮事件为:
NNYFiDataContext nnyfi = new NNYFiDataContext(); List<object> keys = ASPxGridViewgongztgliInfo.GetSelectedFieldValues("gongztgliInfoId"); foreach (object z in keys) { var result = from a in nnyfi.gongztgliInfo where a.gongztgliInfoId==(int)z select a; nnyfi.gongztgliInfo.DeleteAllOnSubmit(result); nnyfi.SubmitChanges(); } ASPxGridViewgongztgliInfo.DataBind();