title: How can I store value inside Telerik Grid in ASP.Net MVC?
body: <p>I am using <code>Telerik grid</code> in ASP.Net MVC, I want to store "Key" in <code>ViewBag/Session</code> and pass it to controller, "Key" is bound with column of <code>telerik grid</code>.
  How can I achieve it? </p>
  
  <p>@(Html.Telerik().Grid()
              .Name("Grid")</p>
  
  <pre><code>        .Columns(columns =&gt;
          {
              columns.Bound(e =&gt; e.Key).Width(140);
          })
          .ClientEvents(events =&gt; events.OnRowDataBound("OnRowDataBound"))
          .DetailView(details =&gt; details.ClientTemplate(
                  Html.Telerik().TabStrip()
                      .Name("TabStrip_&lt;#= Key #&gt;")
                      .SelectedIndex(0)
                      .Items(items =&gt;
                      {
                          items.Add().Text("Resolution").Content(
                                  Html.Telerik().Grid&lt;AnotherModel&gt;()
                                      .Name("Resolutions_&lt;#= Key #&gt;")
                                      .Columns(columns =&gt;
                                      {
                                          columns.Bound(f =&gt; f.CreatedDate).Width(140).Title("Date");
                                          columns.Bound(f =&gt; f.Name).Title("Name");                                      
                                      })
                                      .DataBinding(dataBinding =&gt; dataBinding.Ajax()
                                          .Select("MyControllerAction2", "MyController",PASS_KEY_HERE_EACH_TIME))
                                          //Here instead of PASS_KEY_HERE_EACH_TIME, I need 'Key' to pass here of FirstModel
                                      .Pageable()
                                      .Sortable()
                                      .Filterable()
                                      .Scrollable()
                                      .ToHtmlString()
                                      );
  
                      })
                      .ToHtmlString()
          ))
          .DataBinding(dataBinding =&gt; dataBinding.Ajax().Select("MyControllerAction1", "MyController"))
          .Pageable()
          .Scrollable(scrolling =&gt; scrolling.Height(500))
          .Sortable()
      )
  </code></pre>
  
  <p>controller I want to call each time at binding</p>
  
  <pre><code>    public ActionResult MyControllerAction2(string myKey)
          {
              var test = new List&lt;Data&gt;();
              ProjectDetail projectDetail = new ProjectDetail();
              test = projectDetail.GetData("KEY-123");
              // Actually I want to use Key here which is passed in View at DataBinding(),
                  so that I can get all data I need
              return View(new GridModel(test));
          }
  </code></pre>