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

[Solved] ASP.NET MVC Grid with PartialView

0 Answers 29 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.
TheBigCheese
Top achievements
Rank 2
TheBigCheese asked on 30 Aug 2012, 02:52 PM
Hi, I Have a GridView in a PartialView which works perfectly on the first call.

The scenario is the following:

User search for a "Service" and then a list appears. When the user selects the "service" there is a PartialView Call to the controller which returns a View with 5 Models, each model in it's form, 3 of them are presented with Grids, which are correcly filled the the needed data.

But when a second "service" is selected, the PartialView correctly calls the controller, the view is returned, the same 5 models are returned with the data but the grids don't actually bind.

After some debugging I found that the InstanceModel() is called first the onDataBinding is called next on the first call, but, for the subsequent calls the onDataBinding is being called BEFORE the InstanceModel(), resulting on an incorrect binding, or error, but I'm not able to pinpoint where this behaviour is happening.

The scripts are being placed correctly on the page.


Tags
Grid
Asked by
TheBigCheese
Top achievements
Rank 2
Share this question
or