title: Hierarchical Kendo Grid with local data
body: <p>How to create hierarchical kendo grid with local data? I have a "master" grid as follows:</p>
  
  <pre><code>&lt;section id="master-item"&gt;
      &lt;div class="panel"&gt;
                  @(Html.Kendo().Grid&lt;TheViewModel&gt;()
              .Name("dealerFacilitySchedules")
              .DataSource(data =&gt; data
                  .Ajax()
                  .Model(model =&gt; model.Id(p =&gt; p.FacilityScheduleId))
                  .ServerOperation(false)
              )
              .BindTo(Model.FacilitySchedules)
              .Columns(columns =&gt;
              { /* colums definition */
              })
              /* other staff */
              .ClientDetailTemplateId("slave-item")
          )
      &lt;/div&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>I don't know how to get "slave" item definition. How do I extract the item id in <code>BindTo</code> method?</p>
  
  <pre><code>&lt;script id="slave-item" type="text/kendo-tmpl"&gt;
      @(Html.Kendo().Grid&lt;TheSlaveItemViewModel&gt;()
              .Name("dealerFacilitySchedule#=Id#")
              .DataSource(data =&gt; data
                  .Ajax()
                  .Model(model =&gt; model.Id(p =&gt; p.FacilityScheduleItemId))
                  .ServerOperation(false)
              )
              .BindTo(Model.FacilitySchedules[ **How to add templated ID here??** ])
              .Columns(columns =&gt;
              { /* definition of columns */
              })
              /* other config */
              .ToClientTemplate()
      )
  &lt;/script&gt;
  </code></pre>