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

DropDown in Editor Templates

2 Answers 73 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.
jfkrueger
Top achievements
Rank 1
jfkrueger asked on 04 Jun 2012, 07:33 PM
Hello,

I am using the client editor templates example which is found here: http://demos.telerik.com/aspnet-mvc/razor/grid/clientedittemplates. I can get the dropdown in the editor form (as long as I am not using PopUp) and it is populated and preselected correctly. However, as soon as I click on it it tries to redirect to a page that does not exist and has html as the querystring. Strange... why is it behaving like this? Here is the url of where it is trying to go as soon as I click on a selectlist in my grid editor form:


http://localhost:54741/StoreManager/Details/%3Cdiv%20class=%22t-widget%20t-dropdown%20t-header%22%20tabIndex=%220%22%3E%3Cdiv%20class=%22t-dropdown-wrap%20t-state-focused%22%3E%3Cspan%20class=%22t-input%22%3EClassical%3C/span%3E%3Cspan%20class=%22t-select%22%3E%3Cspan%20class=%22t-icon%20t-arrow-down%22%3Eselect%3C/span%3E%3C/span%3E%3C/div%3E%3Cinput%20style=%22display:%20none;%22%20id=%22GenreSelector%22%20name=%22GenreSelector%22%20value=%221%22%20type=%22text%22%20data-val-required=%22The%20Genre%20field%20is%20required.%22%20data-val=%22true%22%3E%3C/div%3E%3Cspan%20class=%22field-validation-valid%22%20data-valmsg-replace=%22true%22%20data-valmsg-for=%22Genre%22%3E%3C/span%3E

Why is it doing this?? It should not be trying to postback on a selection, I have never told it to do so anywhere so I'm not sure why it is doing this. Thanks in advance for any help!

2 Answers, 1 is accepted

Sort by
0
jfkrueger
Top achievements
Rank 1
answered on 04 Jun 2012, 08:01 PM
Update:

It is doing this because when the row is in edit mode, if you click on a control such as a select list the onRowSelected event fires and I had an event handler setup for this event. Now I have to check whether the row is in edit mode or not in the OnRowSelected event (http://www.telerik.com/community/forums/aspnet-mvc/grid/row-select-while-editing.aspx) and it works great.

Now my question is: Why on earth is it firing the onRowSelected event when the row is in edit mode and you click a control in the row? Seems like that shouldn't happen...
0
Daniel
Telerik team
answered on 07 Jun 2012, 01:48 PM
Hello,

The selection functionality is based on the row click event which will bubble to the row when clicking on a Control inside it. Therefore a check is require in the OnRowSelect event to determine if the row is in edit mode.

Regards,
Daniel
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.
Tags
Grid
Asked by
jfkrueger
Top achievements
Rank 1
Answers by
jfkrueger
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or