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

Where have my records gone?

3 Answers 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 22 Feb 2010, 12:18 PM
Hi I am programatically binding a list to a radgrid. It works fine if I use GridBoundColumn controls ertc.. but when I want to add my own formatting I do it like this:
<telerik:RadGrid  ShowGroupPanel="true" AllowPaging="true" PageSize="10" AutoGenerateColumns="false" Width="700" ID="RadGrid1" runat="server"
 
<MasterTableView TableLayout="Fixed" > 
       
     <ItemTemplate> 
      
      
       <%# Eval("Subject" %> 
       <%# Eval("PostDate")%> 
       <%# Eval("Body")%> 
       <%# Eval("TotalViews")%> 
    
       
      
      
     </ItemTemplate> 
       
   
     
      </MasterTableView> 
 
 
</telerik:RadGrid> 
It tells me there are no records to display - I know there are records there as I can see them when I step into my code. Why does the above not display my records?
Thanks

3 Answers, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 22 Feb 2010, 04:53 PM
Any ideas?
0
robertw102
Top achievements
Rank 1
answered on 22 Feb 2010, 07:43 PM
You need to add columns. Just create one GridTemplateColumn and place that ItemTemplate in it.
0
Princy
Top achievements
Rank 2
answered on 23 Feb 2010, 05:47 AM
Hi,

You need to set the AutoGenerateColumns property to True and not False for the grid to work with ItemTemplate.

Hope this helps.


Thanks,
Princy
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
robertw102
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or