This is a migrated thread and some comments may be shown as answers.
Client Events Prevents AJAX Select from working
1 Answer 55 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stepney
Top achievements
Rank 1
Stepney asked on 15 Apr 2010, 02:40 PM
This is a very odd one.

I have a grid in a partial view that is loaded dynamically. A tree view supplies a parameter to the call to load the view. After some other fun and games I got this to work fine.

Now I am adding events so that when I select an item on the grid a new controller/page is displayed.

When the partial view is loaded for the very first time, the AJAX select does not load the grid. None of the events fire at all i.e. Load, Error, DataBound, etc. However, if I select another item on the tree, the same partial page  is loaded but with a different parameter the grid loads fine and the row can be selected. I can select the original parameter and that works fine too

If I comment out the lines where the events are declared then the grid is loaded fine.

Anyone got any ideas?

1 Answer, 1 is accepted

Sort by
0
Jack Ma
Top achievements
Rank 1
answered on 20 Apr 2010, 02:08 AM
Hi Stepney,
     I almost have the same case with you, i think the grid behavior is kind of odd at least not very clearly to be controlled. 
     My scenario is very simple, I got two grids in one viewpage derived from my viewmodel which holds the data for the two grids. I just want to have the behavior that once user select the first grid and the second grid will show the related information according to the first grid's key information.  I just defined the clientevents OnRowSelected and enable selectable and write a javascript to act the OnRowSelected clientevent, but it does not invoke the javascript  function at all.  Actually I've created another page have the same scenario, and that page works fine, and I just copied the snipped code from that page, and changed something related to the data, others just keep same,  but this time it does not work at all. I totally have no idea what place is wrong. So that's why I said the grid behavior is odd, wired.  By the way, I'm using the telerik extension for MVC, C#.  the document for this MVC extension is very simple, from there I can not understand directly what the method or property is used for and when is the best practice to use it and how.  even the sample code is just very simple, does not explain why the code is there. This is poor to those poor users like me to reference.

If you got any idea to fix this problem, please share with me. Thanks in advance.

Jack 
Tags
Grid
Asked by
Stepney
Top achievements
Rank 1
Answers by
Jack Ma
Top achievements
Rank 1
Share this question
or