Template column not showing when page size changes in radGrid using radclientdatasource.

2 posts, 0 answers
  1. Satish
    Satish avatar
    10 posts
    Member since:
    Oct 2013

    Posted 29 Oct 2014 Link to this post

    Hi,
    I am using radClientDataSource to bind the RadGrid , The client side pagination and page size works fine.like below link.

    http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/client-data-source-binding/defaultcs.aspx?product=clientdatasource

    Problem is : when page size changes from  5 to 10 , the template column (having checkbox in it) is not showing for another 5 rows...first 5 rows i am able to see checkbox control but not for another 5 rows in grid.

    Please help me.

    Below is the code for ref:

    <div>
          <telerik:RadClientDataSource ID="RadClientDataSource1" runat="server">
            <DataSource>
                <WebServiceDataSourceSettings >
                    <Select Url="http://localhost:1100/Invoice/InvoiceService.svc/InvoiceLucen" DataType="JSON" />
                </WebServiceDataSourceSettings>
            </DataSource>
            <Schema>
                <Model>
                    <telerik:ClientDataSourceModelField FieldName="SiteName" DataType="String" />
                      <telerik:ClientDataSourceModelField FieldName="AccountNo" DataType="String" />
                      <telerik:ClientDataSourceModelField FieldName="VendorName" DataType="String" />
                      <telerik:ClientDataSourceModelField FieldName="CommodityName" DataType="String" />
                      <telerik:ClientDataSourceModelField FieldName="ServiceMonth" DataType="Date" />
                  </Model>
            </Schema>
        </telerik:RadClientDataSource>
        <telerik:RadGrid runat="server" ID="RadGrid1" ClientDataSourceID="RadClientDataSource1"
            Width="306px" Skin="DV" AllowPaging ="true" EnableEmbeddedSkins="false" PageSize ="5"  >
            <MasterTableView>
                <Columns>
                     <telerik:GridTemplateColumn UniqueName="CheckBox">
                                            <HeaderTemplate>
                                                <div style="float:left; width:43px;">
                                                <asp:CheckBox ID="ChkHeaderSelect" runat="server" onClick="CheckGrdAllCheckBox(this)" CssClass="queecheckbox" />
                                                </div> 
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="ChkSelect" runat="server" onClick="UncheckheaderCheckBox(this)" />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="SiteName" HeaderText="Site Name" UniqueName="column">
                    </telerik:GridBoundColumn>  
                    <telerik:GridBoundColumn DataField="AccountNo" HeaderText="AccountNo" UniqueName="column1">
                    </telerik:GridBoundColumn>   
                     <telerik:GridBoundColumn DataField="VendorName" HeaderText="Vendor Name" UniqueName="column2">
                    </telerik:GridBoundColumn> 
                     <telerik:GridBoundColumn DataField="CommodityName" HeaderText="Service" UniqueName="column3">
                    </telerik:GridBoundColumn> 
                     <telerik:GridBoundColumn DataField="ServiceMonth" HeaderText="ServiceMonth" UniqueName="column4">
                    </telerik:GridBoundColumn>            
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        </div>



  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 31 Oct 2014 Link to this post

    Hello Satish ,

    Note that the CheckBox is a server-side control. It order for it to be displayed as expected it needs to be rendered on the server. When client-side binding is used for RadGrid it is rendered on the server initially. However, the operations after this are performed client-side. Because no postback is performed when changing page size there are no additional rendered CheckBox controls.

    If you would like to use the CheckBox controls to select rows in RadGrid you might consider using GridClientSelectColumn. It provides this functionality out of the box. Check out the following article that describes the GridClientSelectColumn in more detail:



    Regards,
    Viktor Tachev
    Telerik
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top