title: How to persist selection checkbox state when paging or changing tab on the kendo grid
body: <p>I want to persist selection of checkbox while paging or moving on other tab  in kendo grid .I have referred "How to keep current checkbox state when paging on the grid" here and but i didn't get value of checked and checkbox and also confused with the steps.Please guide in detail.I have attached code below.I have attached script code kendo ui code and html code below.Also thought to use Session to store values of selected checkbox but i  don't know is it right way or not.
  Please guide me as soon as possible.</p>
  
  <pre><code>        &lt;div class="dashboardCharts" id="grid-display"&gt;  
               &lt;div class="count-detail-top right"&gt;
                      &lt;div class="count-detail-bg right"&gt;
                          &lt;ul id="ulOptions"&gt;
                              &lt;li id="Employee" data-type="employee"&gt;&lt;a href="javascript:void(0)"&gt;Employee&lt;/a&gt;&lt;/li&gt;
                              &lt;li id="Visitor" data-type="visitor"&gt;&lt;a href="javascript:void(0)"&gt;Visitor&lt;/a&gt;&lt;/li&gt;                     
                          &lt;/ul&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
         @(Html.Kendo().Grid&lt;xyz.Models.abcModel&gt;()
               .Name("grid")         
              .Columns(columns =&gt;
              {
                  columns.Bound(c =&gt; c.Employee_id).Title("Alert On").Width(200)
                    .ClientTemplate("&lt;input type=\"checkbox\" class=\"checkbox\"  data-id=\"#= Employee_id#\"/&gt;").Sortable(false);                       
                  columns.Bound(c =&gt; c.Employee_name).Title("Employee Name");                                
              })           
           .NoRecords("No Records Found")                           
                 .Events(e =&gt; e.DataBound("onDataBound"))           
                  .DataSource(dataSource =&gt; dataSource                                 
                  .Transport(transport =&gt;
                     transport
                     .Read(read =&gt; read.Url(DataUrl))  
                      .ParameterMap("parameterMap")
                  ))
  
              )
               &lt;/div&gt; 
  
  //code in script :     
         &lt;script&gt; 
            function onDataBound(e) {
  
              $(".checkbox").bind("click", function (e) {
                  e.stopPropagation();
                  $(e.target).closest("tr").toggleClass("k-state-selected");
  
                  var tr = $(e.target).closest("tr");
                  var chk = $(tr).find(".checkbox");
                  var selected = $(chk).attr("data-id");
  
                  var a = selectedIDs.includes(selected);
                  if (a != true) {
                      if ($(chk).prop("checked")) {
                          selectedIDs.push(selected);
                      }
                      else {                   
                       selectedIDs.pop(selected);                 
                      }
                  }
  
              });
  
  
              var gridDataView = $("#grid").data().kendoGrid.dataSource.view();        
              for (var i = 0; i &lt; gridDataView.length; i++) {
                  var panelApplicationId = gridDataView[i].Checkbox;            
                  if (ShouldBeChecked(panelApplicationId)) {
                      $('#grid tr td input').eq(i).prop("checked", true);
                  }
              }       
          }      
           $(document).on('click', 'input.checkbox', function (e) {
              var checked = $(this).prop("checked");
              var gridDataView = $("#grid").data().kendoGrid.dataSource.view();
              console.log(gridDataView);
              var idx = $(this).closest("tr").find("td:nth-child(1)").text();
              var gridData = $("#grid").data().kendoGrid.dataSource.data();
              for (var i = 0; i &lt; gridData.length; i++) {
                  if (gridData[i].ID == idx) {
                      gridData[i].Checkbox = checked;
                      break;
                  }
              }
          });
          function ShouldBeChecked(panelApplicationId) {
              var shouldBeChecked = false;
              var gridData = $("#grid").data().kendoGrid.dataSource.data();
              for (var i = 0; i &lt; gridData.length; i++) {
                  if (gridData[i].Checkbox == panelApplicationId) {
                      if (gridData[i].Checkbox) {
                          shouldBeChecked = true;
                      }
                      break;
                  }
              }
              return shouldBeChecked;
          }
  
      &lt;/script&gt;
  
      code for selected checkbox and and not selected checkbox.
      &lt;input type="checkbox" class="checkbox" data-id="34" checked="checked"&gt;
      &lt;input type="checkbox" class="checkbox" data-id="30"&gt;
  </code></pre>