asp.net mvc - Custom editor template of KendoUI ForeignKey Column -
i'm using kendoui asp wrapper, need changing default foreignkey editor "activitycodeid" autocomplete. how change it?
@(html.kendo().grid<timeentry>() .name("grid-timeentry-project") .datasource(datasource => datasource.ajax() .model(model => { model.id(record => record.timeentryid); model.field(f => f.timesheetid).defaultvalue(0); model.field(f => f.timeentrytypeid).defaultvalue(viewbag.projecttimeentrytypeid); model.field(f => f.activitycodeid); model.field(f => f.description); model.field(f => f.duration); model.field(f => f.dateadded); }) .read(read => read.action("getprojecttimeentries", "timeentry")) ) .columns(columns => { columns.bound(r => r.timeentryid).hidden(true); columns.bound(r => r.timesheetid).hidden(true); columns.bound(r => r.timeentrytypeid).hidden(true); columns.foreignkey(r => r.activitycodeid, (system.collections.ienumerable)viewdata["allactivitycodes"], "activitycodeid", "activitycode1").title("activitycode"); columns.bound(r => r.description); columns.bound(r => r.duration).title("duration (s)"); columns.command(command => { command.edit(); command.destroy(); }).width(170); }) )
i tried modified dataannotation of ef model , declared editortemplate it's still using default "gridforeignkey" editortemplate.
here's ef.
[metadatatype(typeof(timeentrymetadata))] public partial class timeentry { } public class timeentrymetadata { [uihint("activitycodeideditor")] public int activitycodeid { get; set; } }
here's "activitycodeideditor" editor template. can't "asdf" , hence assume editor template not considered.
@model object <span>asdf</span> @*@( html.kendo().dropdownlistfor(m => m) .bindto((selectlist)viewdata[viewdata.templateinfo.getfullhtmlfieldname("") + "_data"])
please help. thanks! )*@
there special column method lets specify name of editor template. try
columns.bound(x=>x.some).editortemplatename("foo");
Comments
Post a Comment