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

why the grid is only displaying one result?

1 Answer 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
zhe
Top achievements
Rank 1
zhe asked on 23 Dec 2008, 09:35 AM
Hi,
I have grid like this:
        <telerik:RadGrid ID="YachetGrid" Width="97%" AllowAutomaticUpdates="False" AllowAutomaticDeletes="False" AllowPaging ="true" PageSize="1"
           OnPageIndexChanged="Yacht_PageChanged"   GridLines="None" runat="server" Skin="Vista" ShowFooter="True" OnItemDataBound="YachetGrid_OnDatabound" EnableEmbeddedSkins="false">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView Width="100%" GridLines="None" CommandItemDisplay="None"  EditMode="InPlace"
                HorizontalAlign="NotSet" DataKeyNames="YachtID" AutoGenerateColumns="false">
                <RowIndicatorColumn Visible="False">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <Columns>
                    <telerik:GridTemplateColumn >
        <ItemTemplate>
            <div>
            <center>
                <h2><asp:Label id="YachetNameLabel" runat="server" ></asp:Label>  </h2>
                <p style="padding-top: 10px; padding-bottom: 5px;">
                <asp:Label id="MainSummaryLabel" runat="server" ></asp:Label>
                </p>
            </center>
            </div>
            <div style="float:left;  width:300px;">
            <table width="100%">
            <tr>
            <td colspan="2" class="OrangeFont"  >
            Details
            </td>
            </tr>
             <tr>
            <td>
            Builder
            </td>
            <td>
            <asp:Label id="BuilderNameLabel" runat="server" ></asp:Label>
            </td>
            </tr>
            </table>
            </div>
            <div style=" margin-left:350px;  width:300px;">
            <table width="100%">
            <tr>
            <td colspan="2" class="OrangeFont" >
            Engine
            </td>
            </tr>
             <tr>
            <td>
            Type
            </td>
            <td>
            <asp:Label id="EngineTypeLabel" runat="server" ></asp:Label>
            </td>
            </tr>
            </table>
            </div>
            <div style="clear:left">
           <table  width="100%">
            <tr>
            <td colspan="2" class="OrangeFont" >
            Refit
            </td>
            </tr>
          <asp:Repeater ID="RefitRepeater" runat="server" OnItemDataBound="RefitRepeater_OnItemDataBound" >
           <ItemTemplate>
           <tr>
           <td>  <asp:Label ID="refitYear" runat="server" ></asp:Label></td>
           <td>  <asp:Label ID="refitContent" runat="server" Text="Label"></asp:Label></td>
           </tr>
           </ItemTemplate>
           </asp:Repeater>
           </table>
       </div>     
            
        </ItemTemplate>
                 </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

It has a table and a repeater in the grid. When Item_databound event happens for the grid, I will bind the repeater.
The problem is that I am sure the database contains more than 1 data, but the grid only displays one. I have set paging style in, but I can't even see the previous and next link (not even disabled ones).

Can someone help me?

Many Thanks

Jerry

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Dec 2008, 10:19 AM
Hello Jerry,

Try setting the PagerStyle>AlwaysVisible property to true as shown below and see if it helps:
aspx:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" PageSize="1"  DataSourceID="SqlDataSource1"
     <MasterTableView> 
      <PagerStyle AlwaysVisible="true" /> 
         .... 

Thanks
Princy.
Tags
Grid
Asked by
zhe
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or