Hello, Robert,
Thank you for the provided screenshot.
Setting a default value for a field could be done within the dataBinding event handler of the Grid. You could check if the filter and add record actions are applied, as well as if the filtered column is the foreign key column. Then with the set() method of the observable set the filtered value.
dataBinding: function(e) {
var filter = this.dataSource.filter();
if(filter && e.action === "add"){
if (filter.filters[0].field === "CategoryID") {
e.items[0].set("CategoryID", filter.filters[0].value);
}
}
}
I have prepared
a dojo example for your convenience.
Let me know if that is a working solution for your case.
Regards,
Silviya Stoyanova
Progress Telerik