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

Sort grid when I'm using a template column

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 21 Apr 2010, 12:07 PM
Hi - my grid is as follows:

<telerik:RadGrid CellSpacing="0" CellPadding="0" OnItemDataBound="rgItemDataBound" Skin="Vista" ShowHeader="true"  PagerStyle-Position="TopAndBottom"  AllowPaging="true" PageSize="10" AutoGenerateColumns="false" Width="700" ID="RadGrid1" runat="server"
 
 
<MasterTableView  > 
 
     
    <Columns> 
    
    <telerik:GridTemplateColumn> 
     
      <ItemTemplate> 
     <div class="documentRow"
      
      
     
      
     <div class="documentInfo"
      
 
<h3>  <%# Eval("Subject").ToString() %></h3
 
 
 
      <class="postDate"><strong>Added:</strong> <%# Eval("PostDate", "{0:dd MMM yyyy}")%> | <strong>Views:</strong>  <%# Eval("TotalViews").ToString() %></p>  
     <class="documentBody">  <%# Eval("Body").ToString() %>  <%#  Eval("PostID", "<href='/media/p/{0}.aspx'>View document</a>") %></p
       
       
        
        
</div> 
 
    
       
     </div> 
      
     </ItemTemplate> 
     
    </telerik:GridTemplateColumn> 
    
       
  </Columns> 
     
      </MasterTableView> 
 
 
</telerik:RadGrid> 

How do I add sorting to this as there aren't clearly defined columns in the grid? I'd like to be able to sort on Subject, PostDate and Views

Thanks

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 21 Apr 2010, 03:57 PM
Hi John,

Please, examine the following help article, which explains how to attain sorting with GridTemplateColumn.
Sorting for GridHyperLinkColumn/GridTemplateColumn

All the best,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or