Note that there are some explanatory texts on larger screens.

plurals
  1. POTelerik MVC Grid not grouping properly
    primarykey
    data
    text
    <p>I'm using the Telerik MVC Grid component to render a groupable grid populated via ajax. The grid renders fine, sorting and paging works, ajax refresh works, but when I try to do grouping, the rendering gets all screwed up. Attached are screen caps of the grid pre- and post-grouping.</p> <p>The grid definition is pretty straight-forward:</p> <pre><code>&lt;div id="tabAccounts" class="tab_content"&gt; @(Html.Telerik().Grid&lt;SharedSimpleAccountListViewModel&gt;() .Name("AcctGrid") .Columns(columns =&gt; { columns.Bound(x =&gt; x.Number) .HeaderHtmlAttributes(new { @style = "text-align: center;" }) .HtmlAttributes(new { @style = "text-align: center;" }); columns.Bound(x =&gt; x.ProviderOrganizationFriendlyName) .Title("Provider"); columns.Bound(x =&gt; x.Name) .Title("Account Name"); columns.Bound(x =&gt; x.BillingLocationName) .Title("Location"); }) .Groupable() .DataBinding(db =&gt; db.Ajax().Select("CustomerAccounts", "Customers", new { id = Model.Id })) .Pageable(pager =&gt; pager.PageSize(50)) .Sortable() ) &lt;/div&gt; </code></pre> <p>The controller action is also straight-forward (I won't paste since it's just a retrieval from the repository). I'm using the Telerik default theme, so there's no custom CSS and I've confirmed that the required scripts are included in the page.</p> <p>Inspecting the HTML after the grouping, it appears that there are changes made to the table, but it's not adding the table row element for the group. Here's the HTML that exists after a grouping attempt:</p> <pre><code>&lt;table cellspacing="0"&gt; &lt;colgroup&gt; &lt;col class="t-group-col"&gt; &lt;col&gt;&lt;col&gt;&lt;col&gt;&lt;col&gt; &lt;/colgroup&gt; &lt;thead class="t-grid-header"&gt; &lt;tr&gt; &lt;th class="t-group-cell t-header"&gt; &lt;/th&gt; &lt;th style="text-align: center;" scope="col" class="t-header"&gt; &lt;a href="/Customers/Details/408?AcctGrid-orderBy=Number-asc" class="t-link"&gt;Number&lt;/a&gt; &lt;/th&gt; &lt;th scope="col" class="t-header"&gt; &lt;a href="/Customers/Details/408?AcctGrid-orderBy=ProviderOrganizationFriendlyName-asc" class="t-link"&gt;Provider&lt;/a&gt; &lt;/th&gt; &lt;th scope="col" class="t-header"&gt; &lt;a href="/Customers/Details/408?AcctGrid-orderBy=Name-asc" class="t-link"&gt;Account Name&lt;/a&gt; &lt;/th&gt; &lt;th scope="col" class="t-header t-last-header"&gt; &lt;a href="/Customers/Details/408?AcctGrid-orderBy=BillingLocationName-asc" class="t-link"&gt;Location&lt;/a&gt; &lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td style="text-align: center;"&gt;00002&lt;/td&gt; &lt;td&gt;Acme&lt;/td&gt; &lt;td&gt;Test account 2 &lt;/td&gt; &lt;td class="t-last"&gt;Location 2&lt;/td&gt; &lt;/tr&gt; &lt;tr class="t-alt"&gt; &lt;td style="text-align: center;"&gt;00001&lt;/td&gt; &lt;td&gt;3M&lt;/td&gt; &lt;td&gt;Test account 1&lt;/td&gt; &lt;td class="t-last"&gt;Location 1&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>Any ideas what might be going on here?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload