Rebinding 2 telerik grids onRowSelecthttp://forums.asp.net/t/1791095.aspx/1?Rebinding+2+telerik+grids+onRowSelectTue, 10 Apr 2012 10:34:49 -040017910954924426http://forums.asp.net/p/1791095/4924426.aspx/1?Rebinding+2+telerik+grids+onRowSelectRebinding 2 telerik grids onRowSelect <p>Hi</p> <p>I have 3 telerik grids on one page and i want to rebind 2 of them when i select a row on the other, my javascript is</p> <p></p> <pre class="prettyprint">function onRowSelected(e) { var notes = $('#notes').data('tGrid'); var clients = $('#clients').data('tGrid'); id = e.row.cells[0].innerHTML; // update ui text $('#id').text(id); // rebind the related grid notes.rebind({ id: id }); clients.rebind({ id: id }); } function onDataBinding(e) { e.data = $.extend(e.data, { id: id }); }</pre> <p>and when i select a row only the notes grid is rebound.&nbsp; If i swap the last 2 lines around like so</p> <p></p> <pre class="prettyprint">clients.rebind({ id: id }); <br />notes.rebind({ id: id }); </pre> <p>only the clients grid is rebound.</p> <p></p> <p>Can anyone help please<br> <br> </p> <p></p> 2012-04-10T08:56:07-04:004924648http://forums.asp.net/p/1791095/4924648.aspx/1?Re+Rebinding+2+telerik+grids+onRowSelectRe: Rebinding 2 telerik grids onRowSelect <p>i think teh problem could be because i am makeing multiple ajax calls? I could be wrong tho</p> <p></p> <p>heres the code for the whole page</p> <p></p> <pre class="prettyprint">&lt;div class=&quot;divCenter&quot;&gt; &lt;table style=&quot;width: 1400px&quot;&gt; &lt;tr&gt; &lt;td&gt; &lt;table&gt; &lt;tr&gt; &lt;td style=&quot;width: 1100px; padding: 5px&quot;&gt; @(Html.Telerik().Grid((IEnumerable&lt;CRM.Lists.lFirms&gt;)ViewData[&quot;firms&quot;]) .Name(&quot;Firms&quot;) .Columns(columns =&gt; { columns.Bound(c =&gt; c.id).Width(&quot;50px&quot;); columns.Template( @&lt;text&gt; &lt;img alt=&quot;&quot; src=&quot;../../Images/@item.logo&quot; height=&quot;60px&quot; width=&quot;50px&quot; /&gt; &lt;/text&gt; ).Title(&quot;logo&quot;).Width(&quot;60px&quot;); columns.Bound(c =&gt; c.name).Title(&quot;Firm&quot;).HtmlAttributes(&quot;style=font:bold&quot;); columns.Bound(c =&gt; c.address1).Title(&quot;Address&quot;); columns.Bound(c =&gt; c.postcode).Title(&quot;PostCode&quot;); columns.Bound(c =&gt; c.stexpirydate).Title(&quot;ST Expiry&quot;); columns.Bound(c =&gt; c.telno).Title(&quot;Tel&quot;); columns.Template(@&lt;text&gt;Web: &lt;a href=&quot;Http://@item.websiteurl&quot; target=&quot;_blank&quot;&gt;@item.websiteurl&lt;/a&gt;&lt;br /&gt; &lt;br /&gt; mail: &lt;a href=&quot;mailto:@item.email&quot;&gt;@item.email&lt;/a&gt;&lt;/text&gt;).Title(&quot;Contact&quot;).Width(&quot;230px&quot;).Visible(false); columns.Bound(c =&gt; c.firmsize).Title(&quot;Size&quot;); columns.Bound(c =&gt; c.sector).Title(&quot;Sector&quot;); }) .Pageable(paging =&gt; paging.PageSize(20).Style(GridPagerStyles.NextPreviousAndNumeric).Position(GridPagerPosition.Bottom)) .Sortable() .Filterable() .Scrollable(c =&gt; c.Height(&quot;450px&quot;)) .Selectable(p =&gt; p.Enabled(true)) .DataKeys(k =&gt; k.Add(a =&gt; a.id)) .ClientEvents(events =&gt; events.OnRowSelected(&quot;onRowSelected&quot;)) .RowAction(row =&gt; { row.Selected = row.DataItem.id.Equals(ViewData[&quot;id&quot;]); }) ) &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style=&quot;height: 300px&quot;&gt; &lt;table&gt; &lt;tr&gt; &lt;td style=&quot;padding: 0&quot;&gt; &lt;div class=&quot;header&quot; id=&quot;id&quot;&gt; &lt;/div&gt; &lt;/td&gt; &lt;td style=&quot;padding: 0&quot;&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style=&quot;padding: 0&quot;&gt; &lt;div class=&quot;subHeader&quot;&gt; Notes&lt;/div&gt; &lt;/td&gt; &lt;td style=&quot;padding: 0&quot;&gt; &lt;div class=&quot;subHeader&quot;&gt; Clients&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style=&quot;width: 500px; padding: 10px&quot;&gt; @(Html.Telerik().Grid((IEnumerable&lt;CRM.Lists.lNotes&gt;)ViewData[&quot;notes&quot;]) .Name(&quot;notes&quot;) .Columns(columns =&gt; { columns.Bound(c =&gt; c.createdby).Title(&quot;Created By&quot;).Width(&quot;60px&quot;); columns.Bound(c =&gt; c.createddate).Title(&quot;Date&quot;).Width(&quot;100px&quot;); columns.Bound(c =&gt; c.notestatus).Title(&quot;Status&quot;).Width(&quot;60px&quot;); columns.Bound(c =&gt; c.notetext).Title(&quot;Note&quot;); }) .Sortable() .Filterable() .Scrollable(c =&gt; c.Height(&quot;150px&quot;)) .Selectable(p =&gt; p.Enabled(true)) .DataBinding(dataBinding =&gt; dataBinding.Ajax().Select(&quot;_SelectionClientSide_Notes&quot;, &quot;Manage&quot;, new { id = 14413 })) .Resizable(resizing =&gt; resizing.Columns(true)) .ClientEvents(clientEvents =&gt; clientEvents.OnDataBinding(&quot;onDataBinding&quot;)) ) &lt;/td&gt; &lt;td style=&quot;width: 600px; padding: 10px&quot;&gt; @(Html.Telerik().Grid((IEnumerable&lt;CRM.Lists.lClients&gt;)ViewData[&quot;clients&quot;]) .Name(&quot;clients&quot;) .Columns(columns =&gt; { columns.Bound(c =&gt; c.title).Title(&quot;Title&quot;); columns.Bound(c =&gt; c.firstname).Title(&quot;FirstName&quot;); columns.Bound(c =&gt; c.lastname).Title(&quot;LastName&quot;); columns.Bound(c =&gt; c.directphone).Title(&quot;Tel&quot;); columns.Bound(c =&gt; c.directmobile).Title(&quot;Mob&quot;); columns.Bound(c =&gt; c.directfax).Title(&quot;fax&quot;); columns.Bound(c =&gt; c.email).Title(&quot;Email&quot;); columns.Bound(c =&gt; c.stexpdate).Title(&quot;ST Exp&quot;); }) .Sortable() .Filterable() .Scrollable(c =&gt; c.Height(&quot;150px&quot;)) .Selectable(p =&gt; p.Enabled(true)) .DataBinding(dataBinding =&gt; dataBinding.Ajax().Select(&quot;_SelectionClientSide_Clients&quot;, &quot;Manage&quot;, new { id = 14413 })) .Resizable(resizing =&gt; resizing.Columns(true)) .ClientEvents(clientEvents =&gt; clientEvents.OnDataBinding(&quot;OnDataBindi&quot;)) ) &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;td style=&quot;width: 300px&quot;&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;script type=&quot;text/javascript&quot;&gt; function onRowSelected(e) { id = e.row.cells[0].innerHTML; str1 = e.row.cells[2].innerHTML; // update ui text $('#id').text('Firm Selected : '.concat(str1)); // rebind the related grid var clients = $('#clients').data('tGrid'); clients.rebind({ clientid: id }); var notes = $('#notes').data('tGrid'); notes.rebind({ id: id }); } function onDataBinding(e) { e.data = $.extend(e.data, { id: id }); } function OnDataBind(e) { e.data = $.extend(e.data, { clientid: id }); } &lt;/script&gt;</pre> <p>thanks in advance<br> <br> </p> 2012-04-10T10:34:49-04:00