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

Client Side Binding - RadGridView could not bind GridTemplateColumn after page size changing

1 Answer 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Badal
Top achievements
Rank 1
Badal asked on 13 Nov 2013, 01:29 PM
Hello,
I am binding radgridview using client side binding. It works properly for sorting, paging, filtering. But, when I change pagesize of gridview (10 to 20 or 50) then it could not bind GridTemplateColumn for new arrived records.
Then I used the demo given on this link :
http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/programmatic/defaultcs.aspx
And added page size and changed columns as per my Database into gridview for binding, but I got same issue here also.
Here, one more issue occurs that when we assign horizontal align to Item-Style then it also doesn’t reflect after pagesize changing.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 18 Nov 2013, 12:42 PM
Hello Badal,

When using client-side binding, the grid does not post back to the server, therefore, it is not able to create and initialize the styles and templates of the new rows. To resolve this problem, you can use the following approach:
<telerik:RadGrid ... PageSize="50" OnPreRender="RadGrid1_PreRender">
C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        RadGrid1.PageSize = 10;
    }
}

Alternatively, you can post back to the server manually as demonstrated in the attached web site.

Hope this helps. Please give it a try and let me know if it works for you.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Badal
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or