This question is locked. New answers and comments are not allowed.
Does anybody know how to preset the value of a combobox on a grid when inserting a new row?
I'm doing this:
although I've tried numerous other things to get it to work. The PDate setting is working fine, but that's just a textbox field.
The editor template looks like this (if it's any help):
Thanks.
I'm doing this:
function Grid_onEdit(e)
{
var mode = e.mode;
var form = e.form;
var PDate = $(form).find('#PDate');
var ProjectID = $(form).find('#ProjectID');
if (mode == 'insert') {
PDate.val('2/1/11');
$(e.form).find('#ProjectID').data('tComboBox').select(function (dataItem) {
return dataItem.Text == "3";
});
}
}
The editor template looks like this (if it's any help):
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<
dynamic
>" %>
<%= Html.Telerik().DropDownList()
.Name("ProjectID")
.BindTo(new SelectList((IEnumerable)ViewData["projects"], "ProjectID", "ProjectDescription"))
%>
Thanks.