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

[Solved] Two Grids but Only One Can Be Retrieved

2 Answers 41 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.
Jerry
Top achievements
Rank 1
Jerry asked on 30 Sep 2011, 03:39 AM
I have two grids in the same form on the same page.  They have different names and I verified that there are no spelling inconsistencies.  When a row is selected in one grid, I want to update the second grid  In the RowSelected event for the first grid, I try to retrieve both grids:

var clientGrid = $("#ClientGrid").data("tGrid");
var planGrid =  $("#PlanGrid").data("tGrid");

planGrid always comes back as "undefined".  Is there something funky you have to do to get two grids working on the same page?

Thanks.

J

2 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 30 Sep 2011, 06:41 AM
Hello Jerry,

No there isn't anything special. If the first grid is initialized properly the second should too.
Here is the demo that illustrates such implementation:
http://demos.telerik.com/aspnet-mvc/grid/selectionclientside

You can check whether the selector returns any object, i.e $("#PlanGrid") selects actually the grid element.

Regards,
Nikolay Rusev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Jerry
Top achievements
Rank 1
answered on 30 Sep 2011, 06:22 PM
That was the problem..  The selector was not returning an object.  But I figured out that the problem was a typo in the name of one of the javascript event handler names.

Thanks.

J
Tags
Grid
Asked by
Jerry
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Jerry
Top achievements
Rank 1
Share this question
or