从客户端在 Telerik RadGrid 中设置 GridCheckBoxColumn
我在 Telerik RadGrid 中有一个 GridCheckBoxColumn。我想循环遍历客户端的所有行并设置每个复选框的值。我不知道如何获得复选框控件。到目前为止我有:
var grid = $find("<%=RadGrid1.ClientID %>");
var masterTableView = grid.get_masterTableView();
if (masterTableView != null) {
var gridItems = masterTableView.get_dataItems();
var i;
for (i = 0; i < gridItems.length; ++i) {
var gridItem = gridItems[i];
// How do I get the checkbox here? Note - since it's a CheckBox column,
// I don't know the id of the checkbox.
// This doesn't work:
var control = gridItem.Controls[0];
control.checked = false;
}
}
I have a GridCheckBoxColumn inside a Telerik RadGrid. I want to loop through all the rows on the client side and set the value of each checkbox. I can't figure out how to get the checkbox control. So far I have:
var grid = $find("<%=RadGrid1.ClientID %>");
var masterTableView = grid.get_masterTableView();
if (masterTableView != null) {
var gridItems = masterTableView.get_dataItems();
var i;
for (i = 0; i < gridItems.length; ++i) {
var gridItem = gridItems[i];
// How do I get the checkbox here? Note - since it's a CheckBox column,
// I don't know the id of the checkbox.
// This doesn't work:
var control = gridItem.Controls[0];
control.checked = false;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了。我是这样做的:
I figured it out. Here's how I did it: