WebGrid enhances its client side events by adding a method to get pending changes.
In this topic, you will learn how to get pending changes based on row state using button click event.
To get pending changes based on row state
- Drag HTML button to your WebForm.
- Write the following code in Button1_onclick client side event:
Javascript Copy Code function Button1_onclick() { var grid = ISGetObject("WebGrid1"); var state = "Modified"; var key = grid.GetChanges(state)[0].KeyValues; alert(key); }
- You can change the state variable to Added, Modified and Deleted. Depends on the row state that you want to get.
- Run the project.