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();
}
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();
}
相关文章推荐
- JavaScript中的for-in语句和with语句
- How To Work With JSON In Node.js / JavaScript
- Make the “Check out” function available in the office document opened with Document ID link
- Receive full data with recv socket function in C
- win8: Asynchronous Programming in JavaScript with “Promises”
- String.ReplaceAll function in JavaScript
- Client Side Validation with JavaScript in ASP.NET
- Trigger a button click with JavaScript on the Enter key in a text box
- Managing DbContext the right way with Entity Framework 6: an in-depth guide by mehdime
- Using #region Directive With JavaScript Files in Visual Studio 【转载】
- execute a Javascript function in a Webbrowser/ IE Document?
- Using #region Directive With JavaScript Files in Visual Studio
- A heat-filled weekend NBA Feet in the form of air jordan shoes, Foamposites, LeBron and others, so lets right it! Rajon Rondo broke necks with Foampos
- Function.apply and Function.call in JavaScript
- sublime配置ESLint_Linting React/JSX and ES6 Javascript with Eslint in Sublime Text 3
- [转]Running JavaScript in an iOS application with JavaScriptCore
- javascript中的遍历for in 以及with的用法
- 【LeetCode with Python】 Populating Next Right Pointers in Each Node
- javascript学习笔记(4)--with和for(in)对象语句
- A for loop javascript event dynamically binding with customized data as paramete passed in test