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

ClientTemplates - Using Server Binding initially then switching to Ajax

0 Answers 22 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jatin
Top achievements
Rank 1
Jatin asked on 03 Aug 2011, 11:42 AM
Hi,
   When I use ClientTemplate and not pass Model object to grid constructor, the view gets loaded first and then there is additional ajax hit to get the Grid data. Ideally I would like to render the complete view including the Grid when the View is loaded so that there is no additional ajax call to get the grid data. So, I was trying to mix up both by passing Model to grid constructor in the view. The view gets loaded but columns templated with ClientTemplate do not render properly (bound column values are loaded instead of the string passed). 

In addition to the extra ajax hit when the view is initially loaded, it also doesn't look good from user interaction perspective. The grid first displays "No Records to Display" in a collapsed view and then after the ajax request suddenly expands to display the data. This might make user believe there is no data if the ajax requests takes a little longer to load.

There is another drawback which I am a little worried of. I have an Edit Page which edits an entity. The user navigates to this page through the telerik grid using ClientTemplate action link column. When the user is done with editing he can come back to the Grid through "Back" button in my edit view. I pick up the GridCommand (stored in session object) and apply that to initial load of the Grid page. This way the user is back to the grid (filtered and on same page). I can't do that with only the Ajax binding since the ajax select action would return only the GridModel and not the whole view.

If anyone can help me out (particularly the last hindrance), I would be very grateful.

regards,
Nirvan.
Tags
Grid
Asked by
Jatin
Top achievements
Rank 1
Share this question
or