您的位置:首页 > Web前端 > JavaScript

Use Refresh() function right in WebGrid with javascript

2008-06-03 18:11 393 查看
First ,make sure that you had added BindData code in InitializeDataSource(object sender, DataSourceEventArgs e) Event .
Sample code:
protected void WebGrid1_InitializeDataSource(object sender, DataSourceEventArgs e)
{
DataTable dt=method.GetDataTable();
e.DataSource = dt;
}

And then you can invoke Refresh() funtion with javascript .
sample code:
function Refresh()
{
var grid = ISGetObject("WebGrid1");
grid.Refresh();
}

BTW,You also can Perform refresh on the particular table only, without refreshing the whole tables (root table and child tables).
sample code:
function refreshChild() {
var grid = ISGetObject("WebGrid1");
grid.Tables[tablename].Refresh();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: