我在 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/