javascript - 是否可以从 javascript 函数调用 telerik radgrid.databind()?

标签 javascript ajax data-binding telerik-grid rad-controls

我在 asp .net 中工作,我有一个带有 telerik radgrid 的 aspx 页面。是否可以从 javascript 函数调用 radgrid.databind() ?

最佳答案

首先,看一下RadControls for ASP.NET AJAX Documentation .我想您会在那里找到所需的一切。

其次,您的问题描述有限且没有包含太多代码,但以下示例可能会为您指明正确的方向。

dataBind - RadControls for ASP.NET AJAX Documentation

Method which will force client rebind of the grid and will refresh its state when a new data source is assigned using the set_dataSource() method. Meaningful in this scenario only.

function assignDataSourceAndRefresh()
{
    var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
    masterTable.set_dataSource(<some_data_source_of_the_specified_type_above>);
    masterTable.dataBind();
}

rebind - RadControls for ASP.NET AJAX Documentation

function RefreshGrid() {
    var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
    masterTable.rebind();
}

最后,here's an alternative suggestion:

If you want to use the .fireCommand(action, params) method try this:

var masterTable = $find("<%= rg.ClientID %>").get_masterTableView();
masterTable.fireCommand("RebindGrid");

关于javascript - 是否可以从 javascript 函数调用 telerik radgrid.databind()?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12702730/

相关文章:

php - 如何在javascript中从CKEDITOR获取选定的html?

javascript - 将输入标签限制为最多 5 个

php - 意外标记 < 错误 json

javascript - 根据服务器响应 vai php 更改 ajax 成功时的变量值

javascript - JS ProgressBar 从 AJAX 调用的 PHP While 循环内部更新?

javascript - 如何在 Yahoo Rich Text Editor 中设置焦点

javascript - 单击图像时不会显示 div

android - 通过绑定(bind)设置可见性 - dimens.xml

vb.net - 如何制作复合用户控件 VB.NET

java - 将 javaFX DoubleProperty 格式设置为 -100.00