Where have my records gone?

4 posts, 0 answers
  1. John
    John avatar
    34 posts
    Member since:
    Apr 2008

    Posted 22 Feb 2010 Link to this post

    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
  2. John
    John avatar
    34 posts
    Member since:
    Apr 2008

    Posted 22 Feb 2010 Link to this post

    Any ideas?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 22 Feb 2010 Link to this post

    You need to add columns. Just create one GridTemplateColumn and place that ItemTemplate in it.
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Feb 2010 Link to this post

    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
Back to Top