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

First action called on grid

1 Answer 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 1
Joel asked on 26 Feb 2013, 01:32 PM
Am I correct in saying that the grid calls the Read operation on its datasource by default?  I am looking at some examples and I can't see where there is an explicit call to read the data from the datasource.  If I am right, is there a way to prevent that and wait for the user to initiate the load?

Thanks

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 26 Feb 2013, 04:51 PM
Hello Joel,

Yes, you are right that the Read operation of the dataSource is called by default. If you want to prevent it, you should set the AutoBind(false) option in the Grid configuration and invoke it manually when needed.

E.g.

@(Html.Kendo().Grid<ProductViewModel>()   
    .Name("Grid")
    .AutoBind(false)
    ...
)

var grid = $("#Grid").data("kendoGrid");
grid.dataSource.read();

  Kind regards,
Dimiter Madjarov
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Joel
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or