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

[Solved] DropDownList in Grid - Behaviour change in Q2 version - Selection is not shown in edit mode/new line

1 Answer 86 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.
dani
Top achievements
Rank 1
dani asked on 28 Oct 2011, 05:38 PM
Hi,
I have a grid with one column that gets it's values from a dropdownlist using this code (below)

Everything worked Great until Q2 version was deployed and than the Template Data is not shown anymore in Edit Mode.
(it is show in any other way, but if you add a new row and pick something from the dropdown list or if you edit the row - you don't see anything until data is save and re-fetched by the ajax call)

Any ideas how to make it work again as before ?

REMARK - This happens on FIREFOX (ver. 7.0.1) but not in IE - in IE it works OK !

c.Bound(o => o.ActivityID).Title("activity").Width(500).ClientTemplate(
                                "<#= Activity.ActivityID#>" + " - " + "<#= Activity.ActivityName #>" +
                                " cost: " + "<#= Activity.Cost #>" + "  $" + " time: " + "<#=Activity.ActivityTimeHours#>" + " housr");// + " hours");

and this script in the page:
<script type="text/javascript">
    function onEdit(e) {
        if ($(e.form).find("#Cost").val() == "") {
            $(e.form).find('#ActivityID').data('tDropDownList').select(function (dataItem) {
                return dataItem.Text == e.dataItem['ActivityID'];
            })
 
        } else {
            $(e.form).find('#ActivityID').attr("disabled", "disabled");
        }
    };
</script>

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 01 Nov 2011, 04:02 PM
Hi Dani,

The code snippets that you provide look OK and should not be the reason for the problem. Please provide a sample project so we can investigate further.


Kind regards,
Georgi Tunev
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
dani
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or