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

client side binding on radgrid - setting pagesize issue

1 Answer 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
diane
Top achievements
Rank 1
Veteran
diane asked on 08 Nov 2011, 09:55 PM
I have the below grid....on page load its empty. Then binds the grid after an action is taken on the page....see js function below. The default page size (10) is not changing to account for the new page size (count) ... how do i fix this?

thanks in advance

 

<telerik:RadGrid runat="server" ID="rgSpecialtyType" AutoGenerateColumns="false" GridLines="None" style="border-width: 1px >

 

 

<HeaderStyle Font-Bold="true"  />

 

 

<ItemStyle Wrap="true" />

 

 

 

<MasterTableView CellPadding="4" CellSpacing="1">

 

 

<Columns>

 

 

<telerik:GridTemplateColumn >

 

 

<HeaderStyle CssClass="colTitle" Width="5%" Height="7%" />

 

 

<HeaderTemplate>

 

 

<asp:CheckBox ID="cbSelectAll" runat="server" onClick="checkAll(this);"></asp:CheckBox>

 

 

</HeaderTemplate>

 

 

<ItemTemplate>

 

 

 

<asp:CheckBox ID="chkBoxST" AutoPostBack="false" runat="server" ></asp:CheckBox>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn UniqueName="ST" DataField="ST" HeaderText=" Specialty Type"  >

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

<ClientSettings>

 

 

<ClientEvents OnCommand="function(){}" />

 

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

Javascript function:

 

 

function PopulateGrid(results,count) {

 

 

 

 

 

var tableView = $find("<%= rgSpecialtyType.ClientID %>").get_masterTableView();

 

 

tableView.set_dataSource(results);
tableView.set_pageSize(count)  //the new page size in not taking in effect....
tableView.dataBind();

 

 

 

}

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Nov 2011, 07:52 AM
Hello Diane,

You can take a look into the following demo.
Grid / Declarative Binding

Thanks,
Shinu.
Tags
Grid
Asked by
diane
Top achievements
Rank 1
Veteran
Answers by
Shinu
Top achievements
Rank 2
Share this question
or