我有一个启用了分页的rad网格。我使用GridClientSelectColumn选择多个页面中的所有行。当我单击打印按钮时,它仅打印在第一页中显示的记录,而不是在多页中选择的所有记录。如何解决它。
这就是我选择多个页面中的所有复选框的方法。
var selected = {};
function radGridWarehouseUtility_RowSelected(sender, args) {
var LID = args.getDataKeyValue("LID");
if (!selected[LID]) {
selected[LID] = true;
}
}
function radGridWarehouseUtility_RowDeselected(sender, args) {
var LID = args.getDataKeyValue("LID");
if (selected[LID]) {
selected[LID] = null;
}
}
function pageLoad() {
var dataItems = $find('<%=radGridWarehouseUtility.ClientID %>').get_masterTableView().get_dataItems();
for (var i = 0, j = dataItems.length; i < j; i++) {
var item = dataItems[i];
if (selected[item.getDataKeyValue("LID")]) {
item.set_selected(true);
}
}
}
<ClientSettings EnablePostBackOnRowClick="true">
<Selecting AllowRowSelect="True"></Selecting>
<ClientEvents OnRowSelected="radGridWarehouseUtility_RowSelected"
OnRowDeselected="radGridWarehouseUtility_RowDeselected" />
</ClientSettings>
<telerik:GridClientSelectColumn UniqueName="Select" /> // Use for for selecting all checkboxes.
代码背后......
Protected Sub btnPrint_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPrint.Click
For Each item As GridDataItem In radGridWarehouseUtility.SelectedItems
Dim item1 As GridDataItem = item
Dim chkBox As CheckBox
chkBox = DirectCast(item1.Item("Select").Controls(0), CheckBox)
If chkBox.Enabled Then
Dim lid As String
lid = CType(radGridWarehouseUtility.MasterTableView.DataKeyValues(item.ItemIndex)("LID"), String)
qryParams = qryParams & lid & ","
End If
Next
End Sub
Plz回复......
提前致谢。