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

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

1 Answer 94 Views
ClientDataSource
This is a migrated thread and some comments may be shown as answers.
Satish
Top achievements
Rank 1
Satish asked on 29 Oct 2014, 08:13 AM
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>



1 Answer, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 31 Oct 2014, 03:12 PM
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
Tags
ClientDataSource
Asked by
Satish
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or