This is a migrated thread and some comments may be shown as answers.

Grouping by wrong header

0 Answers 8 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Steve
Top achievements
Rank 1
Steve asked on 06 May 2011, 11:06 PM
I've got a grid that has about 6 columns two of which have header templates. When I go to group either of the columns it takes the name of the first of these two columns and groups by that. No matter how many columns there are in between. The way this pasted code is set up if you were to try to drag the Attachments column up to be grouped it'd actually group by IsRead. When I switched the order and grouped by IsRead it actually tried to group by the Attachments column.

Am I missing something?

 

 

 

columns.Bound(m => m.IsRead).Width(50)
            .Sortable(false)
            .ClientTemplate("<input type='image' id='<#= Id #>' value='<#= IsRead#>' onclick='toggleUnread(this.id, this.value, <#= MailboxType #> )' src='" + Url.Content("~/Content/Images/") + "<#= ImageName #>.gif'/>")
            .Template(m =>
            {%><input type="image" src="<%= Url.Content("~/Content/Images/"+ m.ImageName +".gif") %>" id="<%=m.Id%>" value="<%=m.IsRead%>" onclick="toggleUnread(this.id, this.value, '<%=m.MailboxType%>');" /> <%})
            .HeaderTemplate(() =>
            { %> <img src="<%= Url.Content("~/Content/Images/envelopeclosedA.gif") %>" alt="" /> <%});
  
         columns.Bound(m => m.HasAttachments).Title("Attachments")
             .Width(10)
             .Groupable(true)
             .Sortable(true)
             .ClientTemplate("<img alt='attachment Icon' src='" + Url.Content("~/Content/Images/attachment.png") + "' <#= HasAttachments?  \"\" : \"style='display:none'\"  #> />")
             .Template(m =>{%> <% if (m.HasAttachments) { %>
                            <img src="<%= Url.Content("~/Content/Images/attachment.png")%>" alt="attachment" />
                            <% } %>  <%})
             .HeaderTemplate(() =>{ %><img src="<%= Url.Content("~/Content/Images/attachment.png")%>" alt="attachment" /><%});

Tags
Grid
Asked by
Steve
Top achievements
Rank 1
Share this question
or