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

Server side binding + client side functions

2 Answers 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Maxime
Top achievements
Rank 1
Maxime asked on 22 Jun 2012, 09:54 AM
Hello all,

I'm currently working with radgrid component.
Here is a sample of what i am doing :

First, Radgrid binded is done on server side :

IList<VT.LibNHSILdb.EntityFAB> myList = SILDB.FabsList();
 
GRD_messages.DataSource = myList[0].LST_MESSAGE;
GRD_messages.DataBind();

I get 5500 records from my list and i'm using paging.
But when i clicked on the paging system on my webpage, Radgrid disapeared.

I solved it by handling the postback action on server side :

if(IsPostBack)
           {
               GRD_messages.DataSource = myList[0].LST_MESSAGE;
               GRD_messages.DataBind();
           }

Of course, each time i try to page data inside my grid, the binding is done again for EVERY data (I guess, it take a lot of time to do it)

I would like to bind all data in one request on the server (keep the one i'm using), and allow paging on the client side. Is it possible ?
Am i doing correctly my binding ? Is there any improvement i could do to make this faster ? (We're using Nhibernate to acces data)

Many thanks !

2 Answers, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 22 Jun 2012, 01:49 PM
Hello Maxime,

Performing complex grid operations such as Inserting, Deleting, Updating, Hierarchy relations, Grouping, Paging, Sorting, Filtering require accommodating appropriate database operations. To use them with simple databinding you will need to declare custom event handling for every operation which requires binding to your DataSource. Therefore, in this case we strongly recommend the use of more advanced databinding methods, which automatically handle the aforementioned functions:
Declarative DataSource
Advanced Data Binding
Advanced Data Binding Demo

That way you will be able to preserve the grid's items upon paging as required.

Regards,
Eyup
the Telerik team
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 their blog feed now.
0
Maxime
Top achievements
Rank 1
answered on 03 Jul 2012, 09:05 AM
Many thanks for the anwser;
I will check this test if it is better for me.
Tags
Grid
Asked by
Maxime
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Maxime
Top achievements
Rank 1
Share this question
or