0

I have using telerik grid in telerik window. However, on saving record in telerik window want to rebind another grid. However, grid is not rebinding. It happens only when you refresh the page. I want some method to be called once ajaxbinding for insert is done so as to rebing another grid.

Krish
  • 43
  • 1
  • 13

1 Answers1

0

This is a little tricky with the Telerik grids. Basically, you need to set a Javascript variable (flag) on submit of grid 1. Then on databinding of grid 1, if the flag is true, then rebind grid 2. Something like this:

var grid1SubmitChanges = false;

function Grid1_OnSubmitChanges(e) {
  grid1SubmitChanges = true;
}

function Grid1_OnDataBinding(e) {
  if (grid1SubmitChanges) {
     // toggle the flag so you don't always rebind Grid2 when Grid1 binds
     grid1SubmitChanges = false;
     // rebind Grid2
     var grid2 = $('#Grid2').data('tGrid');
     grid2.rebind();
  }
}
howcheng
  • 2,211
  • 2
  • 17
  • 24